0
0
Fork 0

Use expect params wrapper for more "auth" and "2FA" "controllers" (#33717)

This commit is contained in:
Matt Jankowski 2025-01-24 09:40:20 -05:00 committed by GitHub
parent e44b78413a
commit a1d9c3fb99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 77 additions and 10 deletions

View file

@ -60,16 +60,12 @@ class Settings::ApplicationsController < Settings::BaseController
end
def application_params
params.require(:doorkeeper_application).permit(
:name,
:redirect_uri,
:scopes,
:website
)
params
.expect(doorkeeper_application: [:name, :redirect_uri, :scopes, :website])
end
def prepare_scopes
scopes = params.fetch(:doorkeeper_application, {}).fetch(:scopes, nil)
scopes = application_params.fetch(:doorkeeper_application, {}).fetch(:scopes, nil)
params[:doorkeeper_application][:scopes] = scopes.join(' ') if scopes.is_a? Array
end
end