Hello,
I have created Interceptor which checks user is logged in and has appropriate authentications or not. upon user has no rights to access given pages i want to redirect him on login page back.
but it is not getting redirected on login page.
Please help..
below is the interceptor code..
@AroundInvoke
public Object checkLoggedIn(InvocationContext invocation) throws Exception {
boolean isLoggedIn = Contexts.getSessionContext().get("currentUser")!=null;
if(isLoggedIn){
return invocation.proceed();
}else{
return "login.xhtml";
}
}