Module: ExceptionHunter::Authorization
- Extended by:
- ActiveSupport::Concern
- Included in:
- ApplicationController
- Defined in:
- app/controllers/concerns/exception_hunter/authorization.rb
Instance Method Summary collapse
- #authenticate_admin_user_class ⇒ Object
- #redirect_to_login ⇒ Object
- #underscored_admin_user_class ⇒ Object
Instance Method Details
#authenticate_admin_user_class ⇒ Object
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_login ⇒ Object
15 16 17 |
# File 'app/controllers/concerns/exception_hunter/authorization.rb', line 15 def redirect_to_login render 'exception_hunter/devise/sessions/new' end |
#underscored_admin_user_class ⇒ Object
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 |