Merge remote-tracking branch 'upstream/pull/3300'

This commit is contained in:
Tom Hughes 2021-10-07 17:45:07 +01:00
commit 5966acc207
12 changed files with 170 additions and 80 deletions

View file

@ -395,4 +395,10 @@ class ApplicationController < ActionController::Base
referer.to_s
end
def scope_enabled?(scope)
doorkeeper_token&.includes_scope?(scope) || current_token&.includes_scope?(scope)
end
helper_method :scope_enabled?
end

View file

@ -20,8 +20,8 @@ class Oauth2ApplicationsController < Doorkeeper::ApplicationsController
end
def application_params
params[:doorkeeper_application][:scopes]&.delete("")
params.require(:doorkeeper_application)
params[:oauth2_application][:scopes]&.delete("")
params.require(:oauth2_application)
.permit(:name, :redirect_uri, :confidential, :scopes => [])
.merge(:owner => current_resource_owner)
end