card-management

This commit is contained in:
2025-05-19 16:30:27 +05:30
parent 2b2605cecc
commit 98f2270614
8 changed files with 375 additions and 20 deletions

View File

@@ -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');
}