From 3a06655a32ce79be8dbddcd7a801344c7482b535 Mon Sep 17 00:00:00 2001 From: Jan Kessler Date: Tue, 9 Jan 2024 16:19:04 +0100 Subject: [PATCH] now display error toast instead of 404 page when LDAP authentication fails --- app/controllers/external_controller.rb | 6 ++++++ config/routes.rb | 1 + 2 files changed, 7 insertions(+) diff --git a/app/controllers/external_controller.rb b/app/controllers/external_controller.rb index a461c32e23..efd6312676 100644 --- a/app/controllers/external_controller.rb +++ b/app/controllers/external_controller.rb @@ -90,6 +90,12 @@ def create_user redirect_to root_path(error: Rails.configuration.custom_error_msgs[:external_signup_error]) end + # GET /auth/failure + # Provide the user with a proper error message in case of external authentication failure + def auth_failure + redirect_to root_path(error: Rails.configuration.custom_error_msgs[:external_signup_error]) + end + # POST /recording_ready # Creates the recording in Greenlight using information received from BigBlueButton def recording_ready diff --git a/config/routes.rb b/config/routes.rb index b79b8b91cc..782ec13ac9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -23,6 +23,7 @@ # External requests get '/auth/:provider/callback', to: 'external#create_user' post '/auth/:provider/callback', to: 'external#create_user' + get '/auth/failure', to: 'external#auth_failure' get '/meeting_ended', to: 'external#meeting_ended' post '/recording_ready', to: 'external#recording_ready'