You can use the default loginForm component and controller. If you want to create a custom component then use the loginForm lightning component and Controller as a reference.
Each community comes with a default set of Login pages: Check Password, Forgot Password, Login, Login Error, Register. Each has a standard Lightning component that drives this functionality. You can add code logic to customize the login experience per your company and community’s requirements.
1. From Setup, enter Lightning Components in the Quick Find box, then select Lightning Components under Develop. 2. From the list of components, click on the one you want to customize. For example, to customize the login experience, click loginForm. 3. On the Lightning component detail page, click Developer Console.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Greetings to you!
You can use the default loginForm component and controller. If you want to create a custom component then use the loginForm lightning component and Controller as a reference.
Each community comes with a default set of Login pages: Check Password, Forgot Password, Login, Login Error, Register. Each has a standard Lightning component that drives this functionality. You can add code logic to customize the login experience per your company and community’s requirements.
1. From Setup, enter Lightning Components in the Quick Find box, then select Lightning Components under Develop.
2. From the list of components, click on the one you want to customize.
For example, to customize the login experience, click loginForm.
3. On the Lightning component detail page, click Developer Console.
You can customize code for Lightning Components on Login Pages: https://help.salesforce.com/articleView?id=networks_custom_login_self_reg_lightning.htm&type=5 (https://help.salesforce.com/articleView?id=networks_custom_login_self_reg_lightning.htm&type=5)
https://sfdcbrothers.wordpress.com/2017/11/01/custom-community-login-lightning-component-salesforce/
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
You can follow this way:
Component:
<aura:componentimplements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global">
<aura:attribute name="ServerUrlAndSessionId" type="List" />
<aura:attribute name="username" type="String" />
<aura:attribute name="password" type="String" />
<aura:attribute name="sessionID" type="String"/>
<aura:attribute name="ContentID" type="String"/>
<aura:attribute name="Spinner" type="boolean" default="false"/> <aura:attribute name="isVisible" type="boolean" default="true"/>
<lightning:input name="username" value= "{!v.username}" label="User Name" placeholder="User Name" aura:id = "uname"/><br/>
</div>
<div class="slds-col slds-size_1-of-2">
<lightning:input type="password" label="Password" value= "{!v.password}" name="password" placeholder="Enter Password" aura:id = "pwd"/> <br/>
</div>
<div class="slds-col slds-size_1-of-2">
<div class="slds-form-element">
<lightning:button variant="brand" label="Login" aura:id="disableenable" disabled="false" title="" onclick="{! c.handleLogin }"/>
</div>
</div>
</aura:component>
Please let me know if you need anym help.
Thanks