mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 00:11:30 +08:00
FEATURE: Mark omniauth failures as HTML safe. (#14713)
Plugins can add HTML elements to auth error messages.
This commit is contained in:
@ -98,8 +98,14 @@ class Users::OmniauthCallbacksController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def failure
|
def failure
|
||||||
error_key = params[:message].to_s.gsub(/[^\w-]/, "") || "generic"
|
error_key = params[:message].to_s.gsub(/[^\w-]/, "")
|
||||||
flash[:error] = I18n.t("login.omniauth_error.#{error_key}", default: I18n.t("login.omniauth_error.generic"))
|
error_key = "generic" if error_key.blank?
|
||||||
|
|
||||||
|
flash[:error] = I18n.t(
|
||||||
|
"login.omniauth_error.#{error_key}",
|
||||||
|
default: I18n.t("login.omniauth_error.generic")
|
||||||
|
).html_safe
|
||||||
|
|
||||||
render 'failure'
|
render 'failure'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user