getToken abstract method Null safety
- AuthServer server,
- {String? byAccessToken,
- String? byRefreshToken}
Returns a AuthToken
searching by its access token or refresh token.
Exactly one of byAccessToken
and byRefreshToken
may be non-null, if not, this method must throw an error.
If byAccessToken
is not-null and there exists a matching AuthToken.accessToken, return that token.
If byRefreshToken
is not-null and there exists a matching AuthToken.refreshToken, return that token.
If no match is found, return null.
server
is the AuthServer requesting the AuthToken
.
Implementation
FutureOr<AuthToken?>? getToken(
AuthServer server, {
String? byAccessToken,
String? byRefreshToken,
});