Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (13 sloc) 629 Bytes

Route Constraints and other integrations

You can leverage the Doorkeeper.authenticate facade to easily extract a Doorkeeper::OAuth::Token based on the current request. You can then ensure that token is still good, find its associated #resource_owner_id, etc.

module Constraint
  class Authenticated

    def matches?(request)
      token = Doorkeeper.authenticate(request)
      token&.accessible?
    end
  end
end

For more information about integration and other integrations, check out the related wiki page.

You can’t perform that action at this time.