I'm using Doorkeeper to manage client applications on a Rails-based API I'm building. I have a controller action in which I'd like to check some information about the client app that submitted the request which the action is handling.
Does Doorkeeper provide a helper or other easy way to access (in a controller) the Doorkeeper::Application that made the request being processed? I'm envisioning an analogue to Devise's 'current_user' method.
If no such helper exists, how can I get this information?
And now I've figured it out.
Doorkeeper provides doorkeeper_token
, which can be accessed in the controller. This is a Doorkeeper::AccessToken
object, which references the app the token belongs to (as doorkeeper_token.application
). This is referenced (in the example code) here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With