From e183dc4fa9e30121335797894456c2c55b5b3f6c Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Mon, 22 Jun 2015 12:56:09 +0200 Subject: [PATCH] Added parameter to enable http_basic auth promt fallback. --- app/controllers/application_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 247d5d316..ef83ebc5d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -177,9 +177,15 @@ class ApplicationController < ActionController::Base } end - def authentication_check + def authentication_check( params = { basic_auth_promt: false } ) result = authentication_check_only + # check if basic_auth fallback is possible + if params[:basic_auth_promt] && result[:auth] == false + + return request_http_basic_authentication + end + # return auth not ok if result[:auth] == false render(