+fix
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user