RefreshTokenManger class

RefreshTokenManger is responsible for when to fetch a brand new id-token just before the expiry of the current one. The updateExpireTime is triggered in two scenarios;

1 . Just after successful login. Ideally this will always be the first call 2 . When the app boots-up. The scenario here is app is removed from stack by user or during development. The app will retrieve the appropriate expiry time, do some time math and determine whether its the right time to call for a a fresh id-token

Constructors

RefreshTokenManger()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
listen ↔ BehaviorSubject<bool>
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timer Timer
getter/setter pair

Methods

checkExpireValidity(String? expireAt) bool
checkExpireValidity for checking whether the expire time is valid. Recommended to be called just before the app draws its first widget in main.dart
ifTokenIsAfterExpiry(DateTime parsed) bool
if user logs in after expiry return true
ifTokenIsApproachingExpiry(DateTime parsed) bool
if user logs in when token is <= 10minutes to expiry return true
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
reset is responsible for resetting the timeout clock and notifying the listener listen when fetch a new token
toString() String
A string representation of this object.
inherited
updateExpireTime(String expire) RefreshTokenManger

Operators

operator ==(Object other) bool
The equality operator.
inherited