FEATURE: use failed_to_login for SSO error (#7394)

The error displayed when logging into suspended accounts via SSO never includes
the suspension reason, unlike non-SSO logins. By re-using the failed_to_login
method when generating the error message for SSO we can ensure the message is
consistent between the SSO and non-SSO paths.
This commit is contained in:
Chris Butler 2019-04-24 07:38:56 +01:00 committed by Sam
parent d4bec7fdfb
commit 8673bd832a

View File

@ -144,7 +144,7 @@ class SessionController < ApplicationController
if user = sso.lookup_or_create_user(request.remote_ip)
if user.suspended?
render_sso_error(text: I18n.t("login.suspended", date: user.suspended_till), status: 403)
render_sso_error(text: failed_to_login(user)[:error], status: 403)
return
end