login method
Implementation
Future<void> login(String email, String password) async {
final result = await ref.read(authRepositoryProvider).login(email, password);
await result.fold(
(failure) async => null, // Error handled by SideEffect in the UI
(data) async {
final (user, token) = data;
await ref.read(storageServiceProvider).setString(_tokenKey, token);
state = AuthState.authenticated(user: user);
},
);
}