Module: ExceptionHunter::Authorization

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/concerns/exception_hunter/authorization.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_admin_user_classObject



9
10
11
12
13
# File 'app/controllers/concerns/exception_hunter/authorization.rb', line 9

def authenticate_admin_user_class
  return unless ExceptionHunter::Config.auth_enabled? && !send("current_#{underscored_admin_user_class}")

  redirect_to '/exception_hunter/login'
end

#redirect_to_loginObject



15
16
17
# File 'app/controllers/concerns/exception_hunter/authorization.rb', line 15

def 
  render 'exception_hunter/devise/sessions/new'
end

#underscored_admin_user_classObject



19
20
21
# File 'app/controllers/concerns/exception_hunter/authorization.rb', line 19

def underscored_admin_user_class
  ExceptionHunter::Config.admin_user_class.underscore
end