You need to sign in to do that
Don't have an account?
Redirecting users after login
Hi we have users with profiles cloned from Partner Portal.All of them login though the Sites.Now I have a need of redirecting these users to different pages after successful login on the basis of their profiles.
I have performed it like this:->
In the SiteLoginController I have done something like this:->
public PageReference login() {
Id profileId = UserInfo.getProfileId();
if(profileId == x)
startURL = '/asd';
else if(profileId == y)
startURL ='/asdwer';
return Site.login(username, password, startUrl) ;
}
Now the problem is a usability issue.When a first time user is made ,he or she would be changing his/her password when he logs into the first time.This changing password page or module is bypassed by my code.
Is there a method of achieving this?
Thanks,
I would suggest another method. Allow these users to login and go to one page ( no redirect) so that the change password page is not bypassed.
Then on that page, you would define an action
<apex:page controller="somecontroller" action="{!myredirect}" > </apex:page>
This action can then look at their profile and send them to the correct page for their profile. All of this happens after they are logged in, so you keep the password stuff inplace.
All Answers
I would suggest another method. Allow these users to login and go to one page ( no redirect) so that the change password page is not bypassed.
Then on that page, you would define an action
<apex:page controller="somecontroller" action="{!myredirect}" > </apex:page>
This action can then look at their profile and send them to the correct page for their profile. All of this happens after they are logged in, so you keep the password stuff inplace.