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)

View File

@ -1,5 +1,5 @@
<h1><%=t 'sso.login_error' %></h1>
<h1><%= t('sso.login_error') %></h1>
<br/>
<p><%= @sso_error %></p>
<p><%=raw @sso_error %></p>

View File

@ -1550,7 +1550,7 @@ en:
unknown_error: "There is a problem with your account. Please contact the site's administrator."
timeout_expired: "Account login timed out, please try logging in again."
no_email: "No email address was provided. Please contact the site's administrator."
email_error: "An account could not be registered with that email address. Please contact the site's administrator."
email_error: "An account could not be registered with the email address <b>%{email}</b>. Please contact the site's administrator."
original_poster: "Original Poster"
most_posts: "Most Posts"