add registration security: bcrypt secret key, length validation, duplicate check, rate limiting

This commit is contained in:
dmit.b
2026-06-25 11:55:55 +03:00
parent efe68ef9a2
commit 6797f3d3c8
6 changed files with 172 additions and 19 deletions
+5
View File
@@ -127,6 +127,11 @@ class DatabaseProvider {
}
Future<User> createUser(String login, String password) async {
final existingUser = await findUserByLogin(login);
if (existingUser != null) {
throw Exception('User already exists');
}
final hashedPassword = BCrypt.hashpw(password, BCrypt.gensalt());
final results = await _dbConnection.execute(