Diff

plugins/mod_auth_internal_hashed.lua @ 8192:4354f556c5db

core.usermanager, various modules: Disconnect other resources on password change (thanks waqas) (fixes #512)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Jul 2017 13:15:29 +0200
parent 8056:cacf14c218ab
child 10218:e458578ddfd3
child 10522:b1ca849b8e3a
line wrap: on
line diff
--- a/plugins/mod_auth_internal_hashed.lua	Sun Aug 06 13:27:47 2017 +0200
+++ b/plugins/mod_auth_internal_hashed.lua	Fri Jul 28 13:15:29 2017 +0200
@@ -120,7 +120,9 @@
 			local credentials = accounts:get(username);
 			if not credentials then return; end
 			if credentials.password then
-				usermanager.set_password(username, credentials.password, host);
+				if provider.set_password(username, credentials.password) == nil then
+					return nil, "Auth failed. Could not set hashed password from plaintext.";
+				end
 				credentials = accounts:get(username);
 				if not credentials then return; end
 			end