• Fawad Ahmed 19
  • NEWBIE
  • 0 Points
  • Member since 2018
  • Salesforce Administrator
  • CloudJunction


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

Hello Everyone,

I have a custom visualforce login page for my community First it takes a lot of time for me to make it appear as the login page, but now what issue i am facing is that whenever any user login to the community it redirects to the default login page and also the login doesnot work there too.

if anyone know this issue please do let me know, i have created the case in salesforce support they suggest me to post here.

Note: I have attached the screenshot for reference if need anything else on that will share.
User-added image

Thanks.

Regards,
Fawad Ahmed
Salesforce Consultant
CloudJunction Advisors Inc

I've created a custom login page for my customer community login members. Here is my controller for the login page:
/**
 * An apex page controller that exposes the site login functionality
 */
global with sharing class CustomLoginController {
    global String username{get;set;}
    global String password{get;set;}
    global CustomLoginController () {}
    global PageReference forwardToCustomAuthPage() {
        return new PageReference( '/CostCenterLogin');
    }
    global PageReference login() {
        return Site.login(username, password, null);
    }

}

Here is the controller for my landing page:
public with sharing class topIdeaExt {
           
    public List<Idea> getRecent2()
    {
        return [SELECT Id, Title, Name__c, CreatedDate, Voting_Status__c FROM Idea order by createdDate desc Limit 2];
    }
    public List<Idea> getMostVoted2()
    {
        return [SELECT Id, Title, Name__c, CreatedDate, Voting_Status__c FROM Idea order by VoteTotal desc, CreatedDate desc Limit 2];
    }
    public List<AggregateResult> getTop6Contributors()
    {
        return [SELECT CreatedById, CreatedBy.Name Name  FROM Idea group by createdbyid, CreatedBy.Name order by count(CreatedById) desc limit 6];
    }
    
     // Code we will invoke on page load.
    public PageReference forwardToCustomAuthPage() {
        if(UserInfo.getUserType() == 'Guest'){
            return new PageReference('/CostCenterLogin');
        }
        else{
            return null;
        }
    }

    public topIdeaExt() {}
}

I've set up the login and landing pages in my communities setup and added customer community login user profile to my settings already. When I go to login as a test user, it seems to load, but it doesn't take me to the landing page.

Any ideas on how to fix this issue? I've been using this as a reference: 
http://appirio.com/category/tech-blog/2013/10/create-custom-salesforce-communities-login-landing-page/

Thanks!