0
0
Fork 0

The frontend will now be an OAuth app, auto-authorized. The frontend will use an access token for API requests

Adding better errors for the API controllers, posting a simple status works from the frontend now
This commit is contained in:
Eugen Rochko 2016-08-26 19:12:19 +02:00
parent 44e57f64dd
commit 92afd29650
16 changed files with 127 additions and 25 deletions

View file

@ -4,7 +4,7 @@ Doorkeeper.configure do
# This block will be called to check whether the resource owner is authenticated or not.
resource_owner_authenticator do
current_user || warden.authenticate!(scope: :user)
current_user || redirect_to(new_user_session_url)
end
resource_owner_from_credentials do |routes|
@ -100,9 +100,9 @@ Doorkeeper.configure do
# Under some circumstances you might want to have applications auto-approved,
# so that the user skips the authorization step.
# For example if dealing with a trusted application.
# skip_authorization do |resource_owner, client|
# client.superapp? or resource_owner.admin?
# end
skip_authorization do |resource_owner, client|
client.superapp?
end
# WWW-Authenticate Realm (default "Doorkeeper").
# realm "Doorkeeper"