fixed warnings
This commit is contained in:
@@ -13,12 +13,11 @@ class AuthRepository {
|
||||
try {
|
||||
final response = await _authService.login(email, password);
|
||||
final user = UserModel(token: response['token'], name: response['name']);
|
||||
return Result.ok(user); // در حالت موفقیت، یک Ok برمیگرداند
|
||||
} catch (e) {
|
||||
// در حالت خطا، یک Error برمیگرداند
|
||||
return Result.error(
|
||||
AuthenticationException('Email or password is not correct.'),
|
||||
);
|
||||
}
|
||||
return Result.ok(user);
|
||||
} on Exception {
|
||||
return Result.error(
|
||||
AuthenticationException('Email or password is not correct.'),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user