Skip to content

Commit

Permalink
Merge pull request #1495 from Matthijsy/bugfix/api-only-applications
Browse files Browse the repository at this point in the history
Make respond_to available for API-Only applications
  • Loading branch information
nbulaj committed Mar 22, 2021
2 parents e048bed + 8b5109e commit d413f42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,7 @@ User-visible changes worth mentioning.
## main

- [#PR ID] Add your PR description here.
- [#1495] Fix `respond_to` undefined in API-only mode
- [#1488] Verify client authentication for Resource Owner Password Grant when
`config.skip_client_authentication_for_password_grant` is set and the client credentials
are sent in a HTTP Basic auth header.
Expand Down
1 change: 1 addition & 0 deletions app/controllers/doorkeeper/application_controller.rb
Expand Up @@ -4,6 +4,7 @@ module Doorkeeper
class ApplicationController <
Doorkeeper.config.resolve_controller(:base)
include Helpers::Controller
include ActionController::MimeResponds if Doorkeeper.config.api_only

unless Doorkeeper.config.api_only
protect_from_forgery with: :exception
Expand Down
Expand Up @@ -26,7 +26,7 @@ def destroy
)
end

format.json { render :no_content }
format.json { head :no_content }
end
end
end
Expand Down

0 comments on commit d413f42

Please sign in to comment.