Fix missing redirect after login
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import 'package:moneymgr_mobile/services/api/api_client.dart';
|
||||
import 'package:moneymgr_mobile/services/api/api_token.dart';
|
||||
import 'package:moneymgr_mobile/services/api/auth_api.dart';
|
||||
import 'package:moneymgr_mobile/services/router/routes_list.dart';
|
||||
import 'package:moneymgr_mobile/services/storage/secure_storage.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
import '../services/router/routes_list.dart';
|
||||
|
||||
part 'auth_state.g.dart';
|
||||
|
||||
/// The current authentication state of the app.
|
||||
@ -27,7 +28,7 @@ class CurrentAuthState extends _$CurrentAuthState {
|
||||
await ApiClient(token: token).authInfo();
|
||||
|
||||
final secureStorage = ref.read(secureStorageProvider).requireValue;
|
||||
secureStorage.setToken(token);
|
||||
await secureStorage.setToken(token);
|
||||
|
||||
ref
|
||||
// Invalidate the state so the auth state will be updated to authenticated.
|
||||
|
Reference in New Issue
Block a user