Skip to content

Commit

Permalink
Make native redirect code a query param
Browse files Browse the repository at this point in the history
This allows for automated flows to detect that an Authorization code was granted in much the same way as a normal redirect. This is used by e.g. Mac Paw.
  • Loading branch information
dv committed Nov 30, 2017
1 parent 414fad1 commit 185c9f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/doorkeeper/rails/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def authorization_routes(mapping)
as: mapping[:as],
controller: mapping[:controllers]
) do
routes.get '/:code', action: :show, on: :member
routes.get '/native', action: :show, on: :member
routes.get '/', action: :new, on: :member
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/authorizations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def translated_error_message(key)

it 'should redirect immediately' do
expect(response).to be_redirect
expect(response.location).to match(/oauth\/authorize\//)
expect(response.location).to match(/oauth\/authorize\/native\?code=/)
end

it 'should issue a grant' do
Expand Down

0 comments on commit 185c9f5

Please sign in to comment.