RefreshTokenStrategy enum
Strategy for handling JWT token refresh.
Values
- responseAndRetry → const RefreshTokenStrategy
-
Refresh the token after receiving a 401 Unauthorized response, then retry the request.
This is the default strategy. The original request is made, and if it returns 401, the token is refreshed and the request is automatically retried with the new token.
- preemptivelyRefreshBeforeExpiry → const RefreshTokenStrategy
-
Check token expiry before each request and refresh proactively if expired.
This strategy prevents 401 errors by checking the JWT expiry time locally and refreshing before the request is made. Requires the JWT to contain a valid
expclaim.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
RefreshTokenStrategy> - A constant List of the values in this enum, in order of their declaration.