comparison plugins/mod_auth_internal_plain.lua @ 13506:1b81a7b7c9b8

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.
author Kim Alvefur <zash@zash.se>
date Fri, 09 Aug 2024 20:23:46 +0200
parents 74b9e05af71e
children
comparison
equal deleted inserted replaced
13504:2159a206684e 13506:1b81a7b7c9b8
20 local provider = {}; 20 local provider = {};
21 21
22 function provider.test_password(username, password) 22 function provider.test_password(username, password)
23 log("debug", "test password for user '%s'", username); 23 log("debug", "test password for user '%s'", username);
24 local credentials = accounts:get(username) or {}; 24 local credentials = accounts:get(username) or {};
25 if credentials.disabled then
26 return nil, "Account disabled.";
27 end
25 password = saslprep(password); 28 password = saslprep(password);
26 if not password then 29 if not password then
27 return nil, "Password fails SASLprep."; 30 return nil, "Password fails SASLprep.";
28 end 31 end
29 32