Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
sessions - Introduced new SessionInvalider component providing an ext…
…ension point to custom behaviours during logout
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
restx-security-basic/src/main/java/restx/security/SessionInvalider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters