From bdc95fb50c2b26fbdf95cf9b640ed33492c5b75d Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Wed, 22 Jun 2016 11:51:58 +0200 Subject: [PATCH] Possible fix for authentication verification --- app/controllers/application_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 45f84eee7..497442cd8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,7 +10,11 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception - before_filter :set_locale, :set_paper_trail_whodunnit + before_filter :set_locale, :set_paper_trail_whodunnit, :auth_user + + def auth_user + redirect_to "/admin/login" unless (request.path == "/admin/login" or user_signed_in?) + end # Code for rescueing lock conflicts errors rescue_from ActiveRecord::StaleObjectError do |exception|