-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added callbacks onTokenExpiring and onTokenExpired * Replaced callbacks onTokenExpiring and onTokenExpired by event types OidcTokenExpiringEvent/OidcTokenExpiredEvent * Do not try to refresh token if not supported by server * format --------- Co-authored-by: ahmednfwela <[email protected]>
- Loading branch information
1 parent
37e5bff
commit 85ba41c
Showing
4 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export 'event.dart'; | ||
export 'pre_logout_event.dart'; | ||
export 'token_expired_event.dart'; | ||
export 'token_expiring_event.dart'; |
18 changes: 18 additions & 0 deletions
18
packages/oidc_core/lib/src/models/events/token_expired_event.dart
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,18 @@ | ||
import 'package:oidc_core/oidc_core.dart'; | ||
|
||
/// An event that gets raised after a token expired. | ||
class OidcTokenExpiredEvent extends OidcEvent { | ||
/// | ||
const OidcTokenExpiredEvent({ | ||
required this.currentToken, | ||
required super.at, | ||
}); | ||
|
||
/// | ||
OidcTokenExpiredEvent.now({ | ||
required this.currentToken, | ||
}) : super.now(); | ||
|
||
/// The current token that is expired. | ||
final OidcToken currentToken; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/oidc_core/lib/src/models/events/token_expiring_event.dart
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,18 @@ | ||
import 'package:oidc_core/oidc_core.dart'; | ||
|
||
/// An event that gets raised before a token expires. | ||
class OidcTokenExpiringEvent extends OidcEvent { | ||
/// | ||
const OidcTokenExpiringEvent({ | ||
required this.currentToken, | ||
required super.at, | ||
}); | ||
|
||
/// | ||
OidcTokenExpiringEvent.now({ | ||
required this.currentToken, | ||
}) : super.now(); | ||
|
||
/// The current token that is expiring. | ||
final OidcToken currentToken; | ||
} |