mirror of
https://github.com/bjc/prosody.git
synced 2025-04-01 20:27:39 +03:00
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:
parent
73aed09475
commit
04f45b1afa
2 changed files with 6 additions and 0 deletions
|
@ -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.";
|
||||
|
|
|
@ -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.";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue