From de812234134b0431476be6af3ed0a7817940ee8d Mon Sep 17 00:00:00 2001 From: shawn-higgins1 <23224097+shawn-higgins1@users.noreply.github.com> Date: Thu, 15 Aug 2019 10:17:32 -0400 Subject: [PATCH] Display launcher errors in Greenlight (#742) --- app/controllers/sessions_controller.rb | 6 +++++- config/locales/en.yml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index c56efc39..cde24e24 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -57,7 +57,11 @@ class SessionsController < ApplicationController # POST /auth/failure def omniauth_fail - redirect_to root_path, alert: I18n.t(params[:message], default: I18n.t("omniauth_error")) + if params[:message].nil? + redirect_to root_path, alert: I18n.t("omniauth_error") + else + redirect_to root_path, alert: I18n.t("omniauth_specific_error", error: params["message"]) + end end # GET /auth/ldap diff --git a/config/locales/en.yml b/config/locales/en.yml index 1d3ebfd7..7298b3ea 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -333,6 +333,7 @@ en: name_update_success: Room name successfully changed! no_user_email_exists: There is no existing user with the email specified. Please make sure you typed it correctly. omniauth_error: An error occured while authenticating with omniauth. Please try again or contact an administrator! + omniauth_specific_error: "%{error} occured while authenticating with omniauth. Please try again or contact an administrator!" pagy: nav: prev: "‹ Prev"