aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_internal_hashed.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_auth_internal_hashed.lua')
-rw-r--r--plugins/mod_auth_internal_hashed.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_auth_internal_hashed.lua b/plugins/mod_auth_internal_hashed.lua
index be22a8d8..c81830de 100644
--- a/plugins/mod_auth_internal_hashed.lua
+++ b/plugins/mod_auth_internal_hashed.lua
@@ -70,6 +70,9 @@ function provider.set_password(username, password)
account.salt = generate_uuid();
account.iteration_count = max(account.iteration_count or 0, default_iteration_count);
local valid, stored_key, server_key = get_auth_db(password, account.salt, account.iteration_count);
+ if not valid then
+ return valid, stored_key;
+ end
local stored_key_hex = to_hex(stored_key);
local server_key_hex = to_hex(server_key);
@@ -101,6 +104,9 @@ function provider.create_user(username, password)
end
local salt = generate_uuid();
local valid, stored_key, server_key = get_auth_db(password, salt, default_iteration_count);
+ if not valid then
+ return valid, stored_key;
+ end
local stored_key_hex = to_hex(stored_key);
local server_key_hex = to_hex(server_key);
return accounts:set(username, {