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;
|
||||
},
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@ class AuthWrapper extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final authState = ref.watch(authProvider);
|
||||
|
||||
print('AuthWrapper build: isAuthenticated=${authState.isAuthenticated}, isLoading=${authState.isLoading}');
|
||||
// Show loading indicator while checking auth status
|
||||
if (authState.isLoading && authState.user == null) {
|
||||
return const Scaffold(
|
||||
|
||||
Reference in New Issue
Block a user