Possible doorkeeper fix

This commit is contained in:
Fosco Marotto 2021-02-10 00:41:25 -05:00
parent a1a97bb483
commit cacfb6e7ba
1 changed files with 4 additions and 4 deletions

View File

@ -63,10 +63,10 @@ class Api::BaseController < ApplicationController
end end
def current_resource_owner def current_resource_owner
if doorkeeper_token ActiveRecord::Base.connected_to(role: :writing) do
@current_user ||= Rails.cache.fetch("dk:user:#{doorkeeper_token.resource_owner_id}", expires_in: 25.hours) do if doorkeeper_token
ActiveRecord::Base.connected_to(role: :writing) do @current_user ||= Rails.cache.fetch("dk:user:#{doorkeeper_token.resource_owner_id}", expires_in: 25.hours) do
User.find(doorkeeper_token.resource_owner_id) User.find(doorkeeper_token.resource_owner_id)
end end
end end
end end