login method
Implementation
Future<void> login(String email, String password) async {
debugPrint('Attempting login for email: $email');
try {
await _auth.signInWithEmailAndPassword(email: email, password: password);
debugPrint('Login successful for email: $email');
// _userId and _lastLoginTime will be set by the authStateChanges listener
} on FirebaseAuthException catch (e) {
debugPrint('Login failed for email: $email, Error: ${e.message}');
rethrow; // Re-throw to be handled by UI
} catch (e) {
debugPrint('Login failed for email: $email, Unexpected Error: $e');
rethrow; // Re-throw to be handled by UI
}
}