Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
sessions - Introduced new SessionInvalider component providing an ext…
…ension point to custom behaviours during logout
- Loading branch information
Showing
with
20 additions
and 3 deletions.
@@ -0,0 +1,16 @@ | ||
package restx.security; | ||
|
||
import restx.factory.Component; | ||
|
||
@Component | ||
public class SessionInvalider { | ||
|
||
public SessionInvalider() { | ||
} | ||
|
||
public void invalidateSession(){ | ||
// Clearing principal | ||
RestxSession.current().clearPrincipal(); | ||
RestxSession.current().define(String.class, Session.SESSION_DEF_KEY, null); | ||
} | ||
} |