1 # frozen_string_literal: true
3 class Oauth2ApplicationsController < Doorkeeper::ApplicationsController
6 prepend_before_action :authorize_web
7 before_action :set_locale
8 before_action :set_application, :only => [:show, :edit, :update, :destroy]
10 authorize_resource :class => false
13 @applications = current_resource_owner.oauth2_applications.ordered_by(:created_at)
19 @application = current_resource_owner&.oauth2_applications&.find(params[:id])
20 rescue ActiveRecord::RecordNotFound
21 render :action => "not_found", :status => :not_found
24 def application_params
25 params[:oauth2_application][:scopes]&.delete("")
27 .expect(:oauth2_application => [:name, :redirect_uri, :confidential, { :scopes => [] }])
28 .merge(:owner => current_resource_owner)