app/controllers/doorkeeper/applications_controller.rb in doorkeeper-5.1.2 vs app/controllers/doorkeeper/applications_controller.rb in doorkeeper-5.2.0.rc1

- old
+ new

@@ -2,10 +2,11 @@ module Doorkeeper class ApplicationsController < Doorkeeper::ApplicationController layout "doorkeeper/admin" unless Doorkeeper.configuration.api_only + add_flash_types :application_secret before_action :authenticate_admin! before_action :set_application, only: %i[show edit update destroy] def index @applications = Application.ordered_by(:created_at) @@ -17,11 +18,11 @@ end def show respond_to do |format| format.html - format.json { render json: @application, as_owner: true } + format.json { render json: @application } end end def new @application = Application.new @@ -30,14 +31,15 @@ def create @application = Application.new(application_params) if @application.save flash[:notice] = I18n.t(:notice, scope: %i[doorkeeper flash applications create]) + flash[:application_secret] = @application.plaintext_secret respond_to do |format| format.html { redirect_to oauth_application_url(@application) } - format.json { render json: @application, as_owner: true } + format.json { render json: @application } end else respond_to do |format| format.html { render :new } format.json do @@ -55,10 +57,10 @@ if @application.update(application_params) flash[:notice] = I18n.t(:notice, scope: i18n_scope(:update)) respond_to do |format| format.html { redirect_to oauth_application_url(@application) } - format.json { render json: @application, as_owner: true } + format.json { render json: @application } end else respond_to do |format| format.html { render :edit } format.json do