diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/oauth/applications_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/profiles_controller.rb | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rb index dc22101cd5e..d983ae0b8c6 100644 --- a/app/controllers/oauth/applications_controller.rb +++ b/app/controllers/oauth/applications_controller.rb @@ -11,6 +11,10 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController head :forbidden and return end + def new + redirect_to applications_profile_url + end + def create @application = Doorkeeper::Application.new(application_params) @@ -20,7 +24,7 @@ class Oauth::ApplicationsController < Doorkeeper::ApplicationsController flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create]) redirect_to oauth_application_url(@application) else - render :new + redirect_to applications_profile_url, flash: {application: @application} end end diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index fa7a1148961..75eb9bdb96f 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -13,6 +13,7 @@ class ProfilesController < Profiles::ApplicationController @authorized_tokens = current_user.oauth_authorized_tokens @authorized_anonymous_tokens = @authorized_tokens.reject(&:application) @authorized_apps = @authorized_tokens.map(&:application).uniq - [nil] + @application = flash[:application] || Doorkeeper::Application.new end def update |