mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Display email address in SSO error message.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user