applyTokens method
Implementation
Future<void> applyTokens(AuthTokens tokens, {bool isNewUser = false}) async {
_tokenManager.setToken(tokens.accessToken);
final user = User.fromJson(tokens.user);
await Future.wait([
_authStorage.saveRefreshToken(tokens.refreshToken),
_authStorage.saveUser(user),
]);
state = state.copyWith(
status: AuthStatus.authenticated,
user: user,
isNewUser: isNewUser,
error: null,
);
}