Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend AuthorizationsController in a to_prepare block #173

Merged
merged 1 commit into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## Unreleased

- [#] Add here
- [#168] Allow to use custom doorkeeper access grant model (thanks @nov).
- [#170] Controllers inherit `Doorkeeper::AppliactionMetalController` (thanks @sato11).
- [#171] Correctly override `AuthorizationsController` params (thanks to @nbulaj).

## v1.8.1 (2022-02-09)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Doorkeeper
module OpenidConnect
module AuthorizationsExtension
private

def pre_auth_param_fields
super.append(:nonce)
end
end
end
end

17 changes: 0 additions & 17 deletions app/controllers/doorkeeper/authorizations_controller.rb

This file was deleted.

4 changes: 4 additions & 0 deletions lib/doorkeeper/openid_connect/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ class Engine < ::Rails::Engine
initializer 'doorkeeper.openid_connect.routes' do
Doorkeeper::OpenidConnect::Rails::Routes.install!
end

config.to_prepare do
Doorkeeper::AuthorizationsController.prepend Doorkeeper::OpenidConnect::AuthorizationsExtension
end
end
end
end
1 change: 1 addition & 0 deletions spec/models/access_grant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
expect(association.options).to eq({
class_name: 'Doorkeeper::OpenidConnect::Request',
inverse_of: :access_grant,
foreign_key: "access_grant_id",
dependent: :delete,
})
end
Expand Down