Display email address in SSO error message.

This commit is contained in:
Robin Ward
2017-03-21 15:37:46 -04:00
parent aeaf5075bf
commit 874e8900af
3 changed files with 8 additions and 4 deletions

View File

@@ -144,7 +144,11 @@ class SessionController < ApplicationController
# If there's a problem with the email we can explain that
if (e.record.is_a?(User) && e.record.errors[:email].present?)
text = e.record.email.blank? ? I18n.t("sso.no_email") : I18n.t("sso.email_error")
if e.record.email.blank?
text = I18n.t("sso.no_email")
else
text = I18n.t("sso.email_error", email: ERB::Util.html_escape(e.record.email))
end
end
render_sso_error(text: text || I18n.t("sso.unknown_error"), status: 500)