changeset 2923:9d53134a0b29

mod_register_web: Return reason for rejection if one was provided by another plugin during pre-registration checks
author Kim Alvefur <zash@zash.se>
date Sat, 10 Mar 2018 02:39:54 +0100
parents 9f60905406ba
children edf5e8a77d0c
files mod_register_web/mod_register_web.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_register_web/mod_register_web.lua	Sat Mar 10 02:38:42 2018 +0100
+++ b/mod_register_web/mod_register_web.lua	Sat Mar 10 02:39:54 2018 +0100
@@ -127,7 +127,7 @@
 	local registering = { username = prepped_username , host = module.host, ip = origin.conn:ip(), allowed = true }
 	module:fire_event("user-registering", registering);
 	if not registering.allowed then
-		return nil, "Registration not allowed";
+		return nil, registering.reason or "Registration not allowed";
 	end
 	if form.confirm_password ~= form.password then
 		return nil, "Passwords don't match";