Skip to content

Commit

Permalink
Merge pull request #224 from nov/feature/priority_on_max_age_and_prompt
Browse files Browse the repository at this point in the history
priority on max age and prompt
  • Loading branch information
nbulaj authored Feb 6, 2025
2 parents 8c1b516 + 9263237 commit cd1b9b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [#222] Support max_age=0
- [#221] Avoid raising invalid_request error on prompt=create
- [#220] Define priority on possible prompt values to statically & successfully process multiple prompt values
- [#224] Define priority between max_age & prompt

## v1.8.10 (2024-11-29)

Expand Down
2 changes: 1 addition & 1 deletion lib/doorkeeper/openid_connect/helpers/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def authenticate_resource_owner!
super.tap do |owner|
next unless oidc_authorization_request?

handle_oidc_prompt_param!(owner)
handle_oidc_max_age_param!(owner)
handle_oidc_prompt_param!(owner)
end
rescue Errors::OpenidConnectError => e
handle_oidc_error!(e)
Expand Down
10 changes: 9 additions & 1 deletion spec/controllers/doorkeeper/authorizations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ def expect_successful_callback!
expect(response).to redirect_to('/select_account')
end

# FIXME:
it 'when login+consent' do
authorize! prompt: 'login consent'
expect(response).to redirect_to('/reauthenticate')
Expand Down Expand Up @@ -382,6 +381,15 @@ def expect_successful_callback!
expect(response).to redirect_to '/reauthenticate'
end
end

context 'when used along with prompt=select_account' do
it 'renders the authorization form' do
user.update! current_sign_in_at: 5.seconds.ago
authorize! max_age: 1, prompt: 'select_account'

expect(response).to redirect_to '/select_account'
end
end
end

describe '#reauthenticate_oidc_resource_owner' do
Expand Down

0 comments on commit cd1b9b0

Please # to comment.