From 8673bd832add5c0e44e5d766a3ffbe63acff49c3 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Wed, 24 Apr 2019 07:38:56 +0100 Subject: [PATCH] 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. --- app/controllers/session_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb index 52732b34c6f..47d6c5c93a2 100644 --- a/app/controllers/session_controller.rb +++ b/app/controllers/session_controller.rb @@ -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