feat: Implement agent network management and refactor app navigation with a new AppShell component.
This commit is contained in:
@@ -51,7 +51,8 @@ class AuthState {
|
||||
class AuthNotifier extends StateNotifier<AuthState> {
|
||||
final AuthRepository _repository;
|
||||
|
||||
AuthNotifier(this._repository) : super(const AuthState()) {
|
||||
AuthNotifier(this._repository)
|
||||
: super(const AuthState(status: AuthStatus.loading)) {
|
||||
// Wire up force logout callback so API client can reset auth state
|
||||
// when token refresh fails
|
||||
ApiClient.onForceLogout = () {
|
||||
@@ -61,14 +62,14 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
}
|
||||
|
||||
Future<void> checkAuthStatus() async {
|
||||
state = state.copyWith(status: AuthStatus.loading);
|
||||
|
||||
final token = await SecureStorage.getAccessToken();
|
||||
if (token == null) {
|
||||
state = state.copyWith(status: AuthStatus.initial);
|
||||
return;
|
||||
}
|
||||
|
||||
state = state.copyWith(status: AuthStatus.loading);
|
||||
|
||||
try {
|
||||
final user = await _repository.getMe();
|
||||
state = state.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user