This content has been marked as final.
Show 1 reply
-
1. Re: RememberMe autoLogin mode problem
fesi Feb 22, 2010 3:22 PM (in response to bartw)Hi Bartek
I see two possible work-arounds for this problem:
1. Replace the Pages component by your own implementation, which replaces the method isLoginRedirectRequired(String viewId, Page page) as follows:
Old: private boolean isLoginRedirectRequired(String viewId, Page page) { return page.isLoginRequired() && !viewId.equals( getLoginViewId() ) && !Identity.instance().isLoggedIn(); } New: private boolean isLoginRedirectRequired(String viewId, Page page) { if (page.isLoginRequired() && !viewId.equals( getLoginViewId() ) && !Identity.instance().isLoggedIn()) { notLoggedIn(); if (!Identity.instance().isLoggedIn()) { return true; } } return false; }
Unfortunately this method is private, so you cannot just override it :-(
2. Add a page action to the login page, which fires a loginSuccessful event, if the user is already logged in, resulting in a call to Redirect.redirectToCapturedView().
I chose the second approach.
Regards,
Felix