You need to sign in to do that
Don't have an account?

what is the function of LightningLoginFormController?
Hi Team,
I see the Apex mentioned below in my org,
ForgotPasswordController
LightningForgotPasswordController
LightningLoginFormController
LightningSelfRegisterController
ChangePasswordController
CommunitiesLandingController
CommunitiesLoginController
CommunitiesSelfRegConfirmController
CommunitiesSelfRegController
It has corresponding Visual force and Aura components.
It looks like they are automatically generated by sfdc.com.
I am not sure under what circumstance do they get generated? Any suggestions?
Where can I find the description for those Apex, Aura and Visual Force Lightning components?
Many Thanks in advance!
I see the Apex mentioned below in my org,
ForgotPasswordController
LightningForgotPasswordController
LightningLoginFormController
LightningSelfRegisterController
ChangePasswordController
CommunitiesLandingController
CommunitiesLoginController
CommunitiesSelfRegConfirmController
CommunitiesSelfRegController
It has corresponding Visual force and Aura components.
It looks like they are automatically generated by sfdc.com.
I am not sure under what circumstance do they get generated? Any suggestions?
Where can I find the description for those Apex, Aura and Visual Force Lightning components?
Many Thanks in advance!
Please find the explanation below:
ForgotPasswordController: LightningForgotPasswordController: LightningLoginFormController: LightningSelfRegisterController: ChangePasswordController: CommunitiesLandingController: CommunitiesLoginController: CommunitiesSelfRegConfirmController: CommunitiesSelfRegController: For more information please refer to below link.
- https://github.com/vaibhavmwarpe/vw_trailhead/tree/master/classes
Hope this helps.Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
I already have all the code in my org.
I need explanation for the apex code, visual force and aura components if available.
@IsTest
public with sharing class LightningLoginFormControllerTest {
@IsTest
static void testLoginWithInvalidCredentials() {
System.assertEquals(null, LightningLoginFormController.login('testUser', 'fakepwd', null));
}
@IsTest
static void LightningLoginFormControllerInstantiation() {
LightningLoginFormController controller = new LightningLoginFormController();
System.assertNotEquals(controller, null);
}
@IsTest
static void testIsUsernamePasswordEnabled() {
System.assertEquals(true, LightningLoginFormController.getIsUsernamePasswordEnabled());
}
@IsTest
static void testIsSelfRegistrationEnabled() {
System.assertEquals(false, LightningLoginFormController.getIsSelfRegistrationEnabled());
}
@IsTest
static void testGetSelfRegistrationURL() {
System.assertEquals(null, LightningLoginFormController.getSelfRegistrationUrl());
}
@IsTest
static void testAuthConfig() {
Auth.AuthConfiguration authConfig = LightningLoginFormController.getAuthConfig();
System.assertNotEquals(null, authConfig);
}
/*
@isTest
static void testForgottenPasswd() {
User u = [SELECT Id, Name, Username FROM User WHERE isPortalEnabled = true AND ContactId != null AND Name = 'Bartosz Test1641' LIMIT 1];
System.debug(u);
String passwdUrl = LightningLoginFormController.getForgotPasswordUrl();
System.debug(passwdUrl);
}
*/
@isTest
static void testCheckUserEmail() {
// call method with unexistant username
Boolean firstCall = LightningLoginFormController.checkUserEmail('testuser123@gamil124.de');
System.assertEquals(false, firstCall);
// create user
User u = new User();
u.FirstName = 'Test';
u.LastName = 'User';
u.Alias = 'tstu';
u.Username = 'testuser123@gamil124.de';
u.Email = 'testuser123@gamil124.de';
u.CommunityNickname = 'testuser123';
u.TimeZoneSidKey = 'GMT';
u.LocaleSidKey = 'en_US';
u.EmailEncodingKey = 'ISO-8859-1';
u.ProfileId = [SELECT Id FROM Profile WHERE Name = 'Standard User' LIMIT 1].Id;
u.LanguageLocaleKey = 'en_US';
insert u;
Boolean secondCall = LightningLoginFormController.checkUserEmail('testuser123@gamil124.de');
System.assertEquals(true, secondCall);
}
@isTest
static void testSetExpId() {
String result = LightningLoginFormController.setExperienceId('asd24');
System.assertNotEquals(null, result);
}
}