You need to sign in to do that
Don't have an account?
Stephen N
Custom Community Login Page - Stuck in loop
I am customizing the CommunitiesLogin page using VF but am having troubles directing to this customized page. When navigating to my_community_url/login I see the standard, out of the box login page. When navigating to my_community_url/CommunitiesLogin my browser gets stuck in a loop.
I have my Community set up as Active Site Home Page = CC_Home, Inactive Site Home Page = CC_Home and the login page set as the Visualforce Page CommunitiesLogin.
Here is my CommunitiesLoginController:
Here is my CommunitiesLandingController:
Here is the first line from the CommunitiesLogin page:
Here is the first line from the CommunitiesLanding page:
Any guesses as to what is causing this loop? Thanks in advance for your assistance.
I have my Community set up as Active Site Home Page = CC_Home, Inactive Site Home Page = CC_Home and the login page set as the Visualforce Page CommunitiesLogin.
Here is my CommunitiesLoginController:
global with sharing class CommunitiesLoginController { global CommunitiesLoginController () {} // Code we will invoke on page load. global PageReference forwardToAuthPage() { String startUrl = System.currentPageReference().getParameters().get('startURL'); String displayType = System.currentPageReference().getParameters().get('display'); return Network.forwardToAuthPage(startUrl, displayType); } //code to invoke custom login page global PageReference forwardToCustomAuthPage() { String startUrl = System.currentPageReference().getParameters().get('startURL'); return new PageReference(Site.getPathPrefix() + '/SiteLogin?startURL=' + EncodingUtil.urlEncode(startURL, 'UTF-8')); } }
Here is my CommunitiesLandingController:
public with sharing class CommunitiesLandingController { // Code we will invoke on page load. public PageReference forwardToStartPage() { return Network.communitiesLanding(); } //code to invoke custom login page public PageReference forwardToCustomAuthPage() { String startUrl = System.currentPageReference().getParameters().get('startURL'); return new PageReference(Site.getPathPrefix() + '/SiteLogin?startURL=' + EncodingUtil.urlEncode(startURL, 'UTF-8')); } public PageReference forwardTocustomStartPage() { return new PageReference('/apex/CC_Home'); } public CommunitiesLandingController() {} }
Here is the first line from the CommunitiesLogin page:
<apex:page id="loginPage" controller="CommunitiesLoginController" action="{!forwardToCustomAuthPage}" title="{!$Label.site.site_login}">
Here is the first line from the CommunitiesLanding page:
<apex:page id="communitiesLandingPage" controller="CommunitiesLandingController" action="{!forwardTocustomStartPage}" title="{!$Label.site.site_login}">
Any guesses as to what is causing this loop? Thanks in advance for your assistance.
Updated code: