This configuration should do two things:
Return the user is currently authenticated
Redirect the user to the authentication page
If you're using devise, one option is to write the following:
config/initializers/doorkeeper.rbDoorkeeper.configure doresource_owner_authenticator docurrent_user || warden.authenticate!(scope: :user)endend
The block above runs in the context of your application so you have access to your models, session and routes helpers. However, it is not run in the context of the
ApplicationController which means that it doesn't have access to the methods defined over there.
You may want to check other ways of authentication here.
By default, the applications list in
/oauth/applications is unavailable. To let users see and manage all applications, you should configure
config/initializers/doorkeeper.rb# config/initializers/doorkeeper.rbDoorkeeper.configure doadmin_authenticator do |routes|current_user || warden.authenticate!(scope: :user)endend
The block follows the same rules as