remove MD5 hashing, send plaintext secret key for bcrypt verification
This commit is contained in:
@@ -24,20 +24,23 @@ class AuthService {
|
||||
Future<void> register(
|
||||
String login,
|
||||
String password,
|
||||
String secretKeyHash,
|
||||
String secretKey,
|
||||
) async {
|
||||
var data = jsonEncode({
|
||||
'login': login,
|
||||
'password': password,
|
||||
'secret_key': secretKey,
|
||||
});
|
||||
final response = await _client.post(
|
||||
Uri.parse(ApiConfig.regUrl),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: jsonEncode({
|
||||
'login': login,
|
||||
'password': password,
|
||||
'secret_key_hash': secretKeyHash,
|
||||
}),
|
||||
body: data,
|
||||
);
|
||||
|
||||
if (response.statusCode != 201) {
|
||||
throw Exception('Registration failed');
|
||||
}
|
||||
}
|
||||
|
||||
int rnLength()=>"\r\n".length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user