Sha256: 5bd04e52d1349c2f8436eb34285ab2f59ed09faad387dbdd628512cba17d1b49

Contents?: true

Size: 730 Bytes

Versions: 1

Compression:

Stored size: 730 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::Helpers::Filter.class_eval do
        alias_method :original_doorkeeper_token, :doorkeeper_token
      end

      included do
        include ::Doorkeeper::Helpers::Filter
        alias_method :doorkeeper_unauthorized_render_options, :unauthorized_render_options
        doorkeeper_for :all
      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-1.0.0 lib/garage/strategy/doorkeeper.rb