Skip to content

Commit

Permalink
Merge pull request #1003 from dv/make-native-auth-code-a-param
Browse files Browse the repository at this point in the history
Make native redirect code a query param
  • Loading branch information
nbulaj authored Jan 29, 2018
2 parents 60bfed6 + 2236363 commit 328765c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ User-visible changes worth mentioning.

## master

- [#1003] Use URL query param to pass through native redirect auth code so automated apps can find it.
- [#868] `Scopes#&` and `Scopes#+` now take an array or any other enumerable
object.
- [#1019] Remove translation not in use: `invalid_resource_owner`.
Expand Down
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=#{Doorkeeper::AccessGrant.first.token}/)
end

it 'should issue a grant' do
Expand Down
1 change: 1 addition & 0 deletions spec/requests/flows/authorization_code_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

access_grant_should_exist_for(@client, @resource_owner)

url_should_have_param('code', Doorkeeper::AccessGrant.first.token)
i_should_see 'Authorization code:'
i_should_see Doorkeeper::AccessGrant.first.token
end
Expand Down

0 comments on commit 328765c

Please sign in to comment.