I'm managing authentication by extending AuthenticatedWebSession
Signing in
@Override
protected boolean authenticate(String username, String password) {
return true/false some auth logic here;
}
Sign out
@Override
public void signOut() {
super.signOut();
this.getApplication().getSecuritySettings().getAuthenticationStrategy().remove();
this.getSessionStore().invalidate(RequestCycle.get().getRequest());
throw new RedirectToUrlException("some_url_that_does_not_require_auth", HttpServletResponse.SC_MOVED_TEMPORARILY);
}
And my page configuration
@AuthorizeInstantiation("ADMIN")
public class Home extends Base {
//Page stuff here
}
Now the problem is that if I log out I can still access authenticated content. Via clicking back button or pasting url to browser. I can only watch the content, when I click on something it redirect me to non-auth page.
When signing out session id changes and session is removed from SecuritySettings, can't figure it out why it still shows auth content.