Sha256: 6406a10256d159e97dcae4ad68af6d2e712f1e288aa5622fae8203c15f68c87e
Contents?: true
Size: 626 Bytes
Versions: 12
Compression:
Stored size: 626 Bytes
Contents
class ApiController < ActionController::API rescue_from CanCan::AccessDenied do |exception| Rails.logger.debug "Access denied on #{exception.action} #{exception.subject.inspect}" head :forbidden end <% if options[:doorkeeper_oauth] %> before_action :doorkeeper_authorize!, unless: :anonymous_action? def current_resource_owner @current_resource_owner ||= User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token&.accessible? end alias current_user current_resource_owner protected def anonymous_action? false end <% else %> def current_user nil end <% end %> end
Version data entries
12 entries across 12 versions & 1 rubygems