Sha256: fd40b84d40eae0e96d5d834671ad8b50428f0c3bf2773c3da2307932be4984c8
Contents?: true
Size: 592 Bytes
Versions: 18
Compression:
Stored size: 592 Bytes
Contents
# frozen_string_literal: true module G5Authenticatable # Authorization helpers and error handling for controllers module Authorization extend ActiveSupport::Concern included do include Pundit rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized end def user_not_authorized respond_to do |format| format.json do render status: :forbidden, json: { error: 'Access forbidden' } end format.html do render status: :forbidden, file: "#{Rails.root}/public/403" end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems