fixed login bug

This commit is contained in:
amirrezaghabeli
2025-08-21 10:59:28 +03:30
parent e5295e0eea
commit f81e9dd32d
4 changed files with 21 additions and 6 deletions
+7 -1
View File
@@ -74,6 +74,12 @@ class AuthViewModel with ChangeNotifier {
notifyListeners();
}
Future<void> localLogout() async {
await _authRepository.localLogout();
_loggedInUser = null;
notifyListeners();
}
Future<void> logout() async {
_errorMessage = null;
notifyListeners();
@@ -82,7 +88,7 @@ class AuthViewModel with ChangeNotifier {
switch (result) {
case Ok<LogoutResponse>():
_loggedInUser = null;
localLogout();
break;
case Error<LogoutResponse>():
_errorMessage = result.error.toString();