login
This commit is contained in:
@@ -127,6 +127,7 @@ class Auth extends _$Auth {
|
||||
|
||||
return result.fold(
|
||||
(failure) {
|
||||
print('❌ Login FAILED: ${failure.message}');
|
||||
state = state.copyWith(
|
||||
isAuthenticated: false,
|
||||
isLoading: false,
|
||||
@@ -135,12 +136,14 @@ class Auth extends _$Auth {
|
||||
return false;
|
||||
},
|
||||
(authResponse) {
|
||||
print('✅ Login SUCCESS: user=${authResponse.user.name}, token length=${authResponse.accessToken.length}');
|
||||
state = AuthState(
|
||||
user: authResponse.user,
|
||||
isAuthenticated: true,
|
||||
isLoading: false,
|
||||
errorMessage: null,
|
||||
);
|
||||
print('✅ State updated: isAuthenticated=${state.isAuthenticated}');
|
||||
return true;
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user