Split welcome and add authview

This commit is contained in:
2026-01-19 11:14:50 +01:00
parent 36af248069
commit 8de8cc2283
4 changed files with 177 additions and 127 deletions

View File

@@ -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();
}
}