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
CSBoxCSBox 

Custom customer portal login form - error returns user to old form

We have skinned our customer portal login and it works great. The problem is, if a user enters a wrong password or user name, it sends them back to the default unstyled login page. We have been told it is possible to analyze the failure return code and present the user with the same skin and graphics, but can't figure out how to do this. Anyone have any advice or idea about how to go about doing this? Thanks for your help.

werewolfwerewolf

Does your login controller class have code that looks like this?

 

 

    public PageReference login() {
        String startUrl = System.currentPageReference().getParameters().get('startURL');
        
        if (startUrl==null || startUrl.equals('')) {
            startUrl = '/home/home.jsp';
        }

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

 

Basically, in my case I'm just returning what Site.login gives me, but I think if the login is unsuccessful then Site.login will return null, and you can check for that and respond to it by returning a different PageReference.