0

How to redirect a user to the homepage if an already authenticated user accesses the login page?

Here is config:

<sec:http authentication-manager-ref="authenticationManagerAlias">
    <sec:form-login login-page="/login.do" always-use-default-target="false" default-target-url="/interceptor.do" authentication-failure-url="/login.do?code=auth" />
    <sec:access-denied-handler ref="accessDeniedHandler"/>
    <sec:session-management session-authentication-error-url="/login.do" invalid-session-url="/login.do"> </sec:session-management>
    <sec:logout invalidate-session="true" logout-success-url="/login.do"/>  
</sec:http>
Ritesh
  • 7,472
  • 2
  • 39
  • 43
sadia
  • 305
  • 1
  • 7
  • 18
  • I didn't understand what you really want to do. If i rephrase, you want to redirect the user to the home page after a login? – akuma8 Apr 06 '17 at 14:20
  • guys I simply want if user is already logged in and then he try to open login page again than he simple redirects to home page, he cannot able to access login page again until he logsout – sadia Apr 06 '17 at 17:22
  • Duplicate of [How to redirect to the homepage if the user accesses the login page after being logged in?](http://stackoverflow.com/questions/12597519) – Ritesh Apr 12 '17 at 02:08

0 Answers0