Prevent Login from being access when already Authenticated

Shannon Dunn asked on August 6, 2015 23:32

Once in a while our customer service department hears of users that get stuck in a loop of logging into the site because the URL they are entering is something like this:

Not sure how they get to this point but they are. In a portal page, is there a way to prevent a user from going to the login page IF they are already authenticated? If I were in my own code I would just check for "IsAuthenticated" in the request in Page_Load but how can I do the same with the portal page? I checked the Kentico 8 Login web part but it has no mechanism I can see.

Recent Answers

Roman Hutnyk answered on August 7, 2015 04:58

You can use random redirect web part for example, which will have just one URL to redirect to, e.g. /Home, and will be available for authenticated users: select 'authenticated' in show to roles field.

This is just first approach that came to my mind, but I'm pretty sure there are several ways to achieve this behavior.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 7, 2015 14:47

There used to be a property to redirect to URL when authenticated. Then I'd typically set the visibility of this webpart to display only to not_authenticated users. I'd also have another webpart on the page that would display to authenticated users and give a friendly message with a link or something like that stating they are already logged in and go "here" to continue.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.