Record Class SessionDecision.Invalidate
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.session.SessionDecision.Invalidate
- Record Components:
reason- short, generic reason (safe for logs)loginRoute- target route to forward to after invalidation (ignored when returned fromonLogin)
- All Implemented Interfaces:
SessionDecision
- Enclosing interface:
SessionDecision
public static record SessionDecision.Invalidate(String reason, String loginRoute)
extends Record
implements SessionDecision
The session must be invalidated. Interpretation depends on the
lifecycle hook that returned the decision:
- From
SessionPolicy.beforeNavigation(SessionContext)— the session is expired/destroyed; drop the subject, invalidate the session, forward tologinRoute. - From
SessionPolicy.onLogin(SessionContext)— session-fixation rotation: rotate the session id (e.g. viaVaadinService.reinitializeSession(...)), preserve the just-bound subject, and continue to the original post-login navigation target.loginRouteis ignored in this context.
-
Nested Class Summary
Nested classes/interfaces inherited from interface SessionDecision
SessionDecision.Continue, SessionDecision.Invalidate, SessionDecision.RequireLoginModifier and TypeInterfaceDescriptionstatic final recordThe navigation may proceed unchanged.static final recordThe session must be invalidated.static final recordThe subject must re-authenticate. -
Constructor Summary
ConstructorsConstructorDescriptionInvalidate(String reason, String loginRoute) Creates an instance of aInvalidaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theloginRouterecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Invalidate
Creates an instance of aInvalidaterecord class.- Parameters:
reason- the value for thereasonrecord componentloginRoute- the value for theloginRouterecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
reason
-
loginRoute
Returns the value of theloginRouterecord component.- Returns:
- the value of the
loginRouterecord component
-