Skip to content

Commit

Permalink
Merge branch '3.5.0-devel-auth' into 3.5.2-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
xhero committed Aug 10, 2016
2 parents 43c65bc + bdc95fb commit 5983dd8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit 5983dd8

Please sign in to comment.