From 0f85ba2f129b6fffb149f94146e977f166b810ed Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Sun, 14 Feb 2021 15:52:38 -0500 Subject: [PATCH] Change the oauth authorizations controller writing role method. --- app/controllers/oauth/authorizations_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb index 6c02c039..5431c2e5 100644 --- a/app/controllers/oauth/authorizations_controller.rb +++ b/app/controllers/oauth/authorizations_controller.rb @@ -9,9 +9,6 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController include Localized - include ForceDbWriterRole - around_action :force_writer_db_role, only: [:store_current_location, :render_success] - private def store_current_location @@ -20,7 +17,9 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController def render_success if skip_authorization? || (matching_token? && !truthy_param?('force_login')) - redirect_or_render authorize_response + ActiveRecord::Base.connected_to(role: :writing) do + redirect_or_render authorize_response + end elsif Doorkeeper.configuration.api_only render json: pre_auth else