setTokenPair static method
Implementation
static Future setTokenPair({
String? accessToken,
String? refreshToken,
}) async {
if (accessToken?.isEmpty ?? true) {
throw Exception("access token is empty");
}
if (refreshToken?.isEmpty ?? true) {
throw Exception("refresh token is empty");
}
var response = await _heraClient
.get(HeraRequest(authToken: AuthToken(userToken: accessToken)));
_setCurrentUser(response.user);
_setAccessToken(accessToken ?? "");
_setRefreshToken(refreshToken ?? "");
onAuthenticated();
}