Software /
code /
prosody-modules
Changeset
3353:e8d6f602f382
mod_password_reset: Improve error reporting when setting a password fails
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 09 Oct 2018 14:10:42 +0100 |
parents | 3352:f7668aee968a |
children | 3354:7cede636b3d5 |
files | mod_password_reset/mod_password_reset.lua mod_sms_clickatell/mod_sms_clickatell.lua |
diffstat | 2 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_password_reset/mod_password_reset.lua Tue Oct 09 14:09:54 2018 +0100 +++ b/mod_password_reset/mod_password_reset.lua Tue Oct 09 14:10:42 2018 +0100 @@ -1,6 +1,7 @@ local adhoc_new = module:require "adhoc".new; local adhoc_simple_form = require "util.adhoc".new_simple_form; local new_token = require "util.id".long; +local new_error_id = require "util.id".short; local jid_prepped_split = require "util.jid".prepped_split; local http_formdecode = require "net.http".formdecode; local usermanager = require "core.usermanager"; @@ -61,10 +62,11 @@ return apply_template(result_template, { classes = "alert-success", message = "Your password has been updated! Happy chatting :)" }) else - module:log("debug", "Resetting password failed: " .. tostring(err)); + local error_id = new_error_id(); + module:log("warn", "Resetting password for %s failed: %s [%s]", reset_info.user, err, error_id); return apply_template(result_template, { classes = "alert-danger"; - message = "An unknown error has occurred."; + message = "An unknown error has occurred. Please contact your administrator and quote error id '"..error_id.."'"; }) end end
--- a/mod_sms_clickatell/mod_sms_clickatell.lua Tue Oct 09 14:09:54 2018 +0100 +++ b/mod_sms_clickatell/mod_sms_clickatell.lua Tue Oct 09 14:10:42 2018 +0100 @@ -234,7 +234,7 @@ function iq_success(origin, stanza) local reply = data_cache.success; if reply == nil then - reply = st.iq({type='result', from=stanza.attr.to or component_host}); + reply = st.reply(stanza); data_cache.success = reply; end reply.attr.id = stanza.attr.id;