diff 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
line wrap: on
line diff
--- a/plugins/mod_auth_internal_plain.lua	Sat Aug 03 16:28:59 2024 +0200
+++ b/plugins/mod_auth_internal_plain.lua	Fri Aug 09 20:23:46 2024 +0200
@@ -22,6 +22,9 @@
 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.";