Split welcome and add authview
This commit is contained in:
@@ -32,11 +32,13 @@ class AuthenticationManager extends ChangeNotifier {
|
||||
}
|
||||
|
||||
bool _isAuthenticated = false;
|
||||
bool _isInitializing = true;
|
||||
String _apiToken = '';
|
||||
UserInfo? _userInfo;
|
||||
BrandmeisterClient? _client;
|
||||
|
||||
bool get isAuthenticated => _isAuthenticated;
|
||||
bool get isInitializing => _isInitializing;
|
||||
String get apiToken => _apiToken;
|
||||
UserInfo? get userInfo => _userInfo;
|
||||
|
||||
@@ -50,7 +52,6 @@ class AuthenticationManager extends ChangeNotifier {
|
||||
try {
|
||||
_userInfo = await _client!.whoami();
|
||||
_isAuthenticated = true;
|
||||
notifyListeners();
|
||||
} catch (e) {
|
||||
// Token is invalid, clear it
|
||||
await logout();
|
||||
@@ -58,6 +59,9 @@ class AuthenticationManager extends ChangeNotifier {
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('Error loading token: $e');
|
||||
} finally {
|
||||
_isInitializing = false;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user