remove MD5 hashing, send plaintext secret key for bcrypt verification

This commit is contained in:
dmit.b
2026-06-25 11:56:08 +03:00
parent 4e7a9d823b
commit 86e9b5a22a
4 changed files with 18 additions and 21 deletions
+9 -6
View File
@@ -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;
}