Mercurial > prosody-hg
comparison plugins/mod_auth_internal_hashed.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 | 1796370091d4 |
| children |
comparison
equal
deleted
inserted
replaced
| 13504:2159a206684e | 13506:1b81a7b7c9b8 |
|---|---|
| 35 local provider = {}; | 35 local provider = {}; |
| 36 | 36 |
| 37 function provider.test_password(username, password) | 37 function provider.test_password(username, password) |
| 38 log("debug", "test password for user '%s'", username); | 38 log("debug", "test password for user '%s'", username); |
| 39 local credentials = accounts:get(username) or {}; | 39 local credentials = accounts:get(username) or {}; |
| 40 if credentials.disabled then | |
| 41 return nil, "Account disabled."; | |
| 42 end | |
| 40 password = saslprep(password); | 43 password = saslprep(password); |
| 41 if not password then | 44 if not password then |
| 42 return nil, "Password fails SASLprep."; | 45 return nil, "Password fails SASLprep."; |
| 43 end | 46 end |
| 44 | 47 |
