function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DivyaReddyDivyaReddy 

very urgent issue on customer portal

How can i redirect to other visualforce page when the login credential is true.

 

Here i am posting my code :

 

global with sharing class SiteLoginController {
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
         return Site.login(username, password, startUrl);

        // return null;

       //return.page.Account;

        
    }

 

if return null is giving it is returing nothing as usally.

 

if return page.Account; is giving then it is redirecting with out validating login credential is true.

 

 

Can any one help on this issue.

EIE50EIE50

Hi,

 

Hope this should help you.

 

global class SiteLoginController {
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        if (startUrl == null) startURL = (Site.getPrefix() == null ? '' : Site.getPrefix()) + '/home/home.jsp';
        return Site.login(username, password, startUrl);
    }

 Thanks.

sekharasekhara

it is not working

 

i am getting error as :

 

/ is under construction 

Stay tuned. Please email us if you need to get in touch.


please rectify my problem

EIE50EIE50

Is user able to login now and being re-directed to under construction page???

 

then, Play around with this part "/home/home.jsp"

sekharasekhara

Ya user can able to login & it is redirecting to "/error.jsp"

hemantgarghemantgarg

You can try like following :-

 

 

global with sharing class SiteLoginController {
    global String username {get; set;}
    global String password {get; set;}

    global PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        startUrl = '/apex/<Your page name>' ;     

         return Site.login(username, password, startUrl);             
    }

}

 

 

seahorcesolnsseahorcesolns

Did you ever get a solution to this?  I am having the same problem.  When I use '/home/home.jsp' as my startURL, I get taken to the portal home page, but the main section of the home page says "https://mycompany.secure.force.com/portal/ is under construction" (mycompany is my domain name).