User can sign out of his account
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2025-07-08 19:54:16 +02:00
parent 5b16ca6162
commit 52bbcf708f
4 changed files with 72 additions and 3 deletions

View File

@ -42,9 +42,14 @@ class CurrentAuthState extends _$CurrentAuthState {
/// Logs out, deletes the saved token and profile info from storage, and invalidates
/// the state.
Future<void> logout() async {
final prefs = ref.read(prefsProvider).requireValue;
final secureStorage = ref.read(secureStorageProvider).requireValue;
await secureStorage.removeToken();
prefs.clearServerConfig();
prefs.clearAuthInfo();
ref
// Invalidate the state so the auth state will be updated to authenticated.
.invalidateSelf();