mod_auth_internal_{hashed,plain}: Respect flag for disabled accounts in test_password()

This API method is used e.g. in HTTP modules which also should respect
disabled accounts.
This commit is contained in:
Kim Alvefur 2024-08-09 20:23:46 +02:00
parent 73aed09475
commit 04f45b1afa
2 changed files with 6 additions and 0 deletions

View file

@ -37,6 +37,9 @@ local provider = {};
function provider.test_password(username, password)
log("debug", "test password for user '%s'", username);
local credentials = accounts:get(username) or {};
if credentials.disabled then
return nil, "Account disabled.";
end
password = saslprep(password);
if not password then
return nil, "Password fails SASLprep.";

View file

@ -22,6 +22,9 @@ local provider = {};
function provider.test_password(username, password)
log("debug", "test password for user '%s'", username);
local credentials = accounts:get(username) or {};
if credentials.disabled then
return nil, "Account disabled.";
end
password = saslprep(password);
if not password then
return nil, "Password fails SASLprep.";