Skip to content

Commit

Permalink
permit nonce parameter in authorization request
Browse files Browse the repository at this point in the history
  • Loading branch information
linhdangduy committed Nov 17, 2019
1 parent c70acc9 commit ab4850d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/controllers/doorkeeper/authorizations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

require_dependency "#{Doorkeeper::Engine.root}/app/controllers/doorkeeper/authorizations_controller.rb"

module Doorkeeper
class AuthorizationsController
module AuthorizationsExtension
private

def pre_auth_param_fields
super.append(:nonce)
end
end

Doorkeeper::AuthorizationsController.send :prepend, AuthorizationsExtension
end
end
7 changes: 7 additions & 0 deletions spec/controllers/doorkeeper/authorizations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,11 @@ def reauthenticate!
end
end
end

describe '#pre_auth' do
it 'permits nonce parameter' do
authorize! nonce: '123456'
expect(assigns(:pre_auth).nonce).to eq '123456'
end
end
end

0 comments on commit ab4850d

Please sign in to comment.