Sha256: 9493a15af0fce4ae5132aff928ccb4f60d6674ec7add2d5e922cea39eba679ee

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

module Garage
  module Strategy
    # doorkeeper_token has same interface with Garage::Strategy::AccessToken
    module Doorkeeper
      extend ActiveSupport::Concern

      # Garage::ControllerHelper already implements `doorkeeper_token`,
      # so monkey patch here.
      ::Doorkeeper::Rails::Helpers.class_eval do
        alias_method :original_doorkeeper_token, :doorkeeper_token
      end

      included do
        before_action :doorkeeper_authorize!
        alias_method :doorkeeper_unauthorized_render_options, :unauthorized_render_options
      end

      def verify_permission?
        true
      end

      def access_token
        original_doorkeeper_token
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
garage-doorkeeper-2.0.0 lib/garage/strategy/doorkeeper.rb