Fix existing token not being validated properly
This commit is contained in:
parent
cd6e5c5747
commit
77e604cf50
1 changed files with 6 additions and 6 deletions
|
|
@ -64,18 +64,18 @@ abstract class _AuthBase with Store {
|
|||
await _storage.write(key: _defaultTokenKey, value: _token);
|
||||
}
|
||||
} else {
|
||||
// Validate the existing token.
|
||||
_tokenIsValid = await twitchApi.validateToken(token: _token!);
|
||||
|
||||
// If the token is invalid, logout.
|
||||
if (!_tokenIsValid) return await logout();
|
||||
|
||||
// Initialize the user store.
|
||||
await user.init(headers: headersTwitch);
|
||||
|
||||
if (user.details != null) _isLoggedIn = true;
|
||||
}
|
||||
|
||||
// Validate the token.
|
||||
_tokenIsValid = await twitchApi.validateToken(token: _token!);
|
||||
|
||||
// If the token is invalid, logout.
|
||||
if (!_tokenIsValid) await logout();
|
||||
|
||||
_error = null;
|
||||
} catch (e) {
|
||||
debugPrint(e.toString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue