Use checkboxes for application scope setting (#4671)
This commit is contained in:
parent
8d23667536
commit
80393a23d0
3 changed files with 44 additions and 6 deletions
|
@ -5,6 +5,7 @@ class Settings::ApplicationsController < ApplicationController
|
|||
|
||||
before_action :authenticate_user!
|
||||
before_action :set_application, only: [:show, :update, :destroy, :regenerate]
|
||||
before_action :prepare_scopes, only: [:create, :update]
|
||||
|
||||
def index
|
||||
@applications = current_user.applications.page(params[:page])
|
||||
|
@ -63,4 +64,9 @@ class Settings::ApplicationsController < ApplicationController
|
|||
:website
|
||||
)
|
||||
end
|
||||
|
||||
def prepare_scopes
|
||||
scopes = params.fetch(:doorkeeper_application, {}).fetch(:scopes, nil)
|
||||
params[:doorkeeper_application][:scopes] = scopes.join(' ') if scopes.is_a? Array
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue