Sha256: abd18da61980678bb1b16ccf21a9ebb1845a7af49537fbe2e38dfd32ed7a6da7

Contents?: true

Size: 400 Bytes

Versions: 1

Compression:

Stored size: 400 Bytes

Contents

module Raddar
  class ApplicationController < ActionController::Base
    include Pundit

    after_action :verify_authorized, unless: :devise_controller?

    rescue_from Pundit::NotAuthorizedError do |exception|
      if user_signed_in?
        self.response_body = nil

        redirect_to root_path, alert: t('flash.unauthorized')
      else
        authenticate_user!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
raddar-0.0.1.pre app/controllers/raddar/application_controller.rb