This commit is contained in:
dmit.b
2026-07-05 12:42:04 +03:00
parent f011a121d7
commit 98cd704234
8 changed files with 81 additions and 69 deletions
+3
View File
@@ -8,6 +8,7 @@ class AuthService {
AuthService({http.Client? client}) : _client = client ?? http.Client();
Future<String> login(String login, String password) async {
print(ApiConfig.loginUrl);
final response = await _client.post(
Uri.parse(ApiConfig.loginUrl),
headers: {'Content-Type': 'application/json'},
@@ -17,6 +18,8 @@ class AuthService {
if (response.statusCode == 200) {
return response.body;
} else {
print(response.statusCode);
print(response.body);
throw Exception('Invalid credentials');
}
}