card-management
This commit is contained in:
@@ -20,7 +20,7 @@ class AuthService {
|
||||
Future<AuthToken> login(AuthCredentials credentials) async {
|
||||
try {
|
||||
final response = await _dio.post(
|
||||
'/auth/login',
|
||||
'/login',
|
||||
data: credentials.toJson(),
|
||||
);
|
||||
|
||||
@@ -30,6 +30,9 @@ class AuthService {
|
||||
throw AuthException('Login failed');
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
if (kDebugMode) {
|
||||
print(e.toString());
|
||||
}
|
||||
if (e.response?.statusCode == 401) {
|
||||
throw AuthException('Invalid credentials');
|
||||
}
|
||||
|
Reference in New Issue
Block a user