Skip to content

Commit

Permalink
DRY out AuthorizationsController#render_success
Browse files Browse the repository at this point in the history
In our own deployment, we have some custom exception handling around
the `create`` method. By calling the more "public" `create` method in
`render_success`, we get to have a _single_ code path that also supports
`skip_authorization?` and `can_authorize_response?`. The code on L35
is identical to L16.  That suggests identical intent, but not always.
This might be coincidental, in which case, the pull request should be
declined.
  • Loading branch information
kmayer committed May 6, 2024
1 parent 8626b85 commit c2a2dbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ User-visible changes worth mentioning.
## main

Add your entry here.
- [#????] DRY out AuthorizationsController#render_success

## 5.7.0

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/doorkeeper/authorizations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def destroy

def render_success
if skip_authorization? || can_authorize_response?
redirect_or_render(authorize_response)
create
elsif Doorkeeper.configuration.api_only
render json: pre_auth
else
Expand Down

0 comments on commit c2a2dbc

Please sign in to comment.