[fix] Logged out user session issue.

This commit is contained in:
Fosco Marotto 2021-01-27 00:24:54 -05:00
parent 0120a2b361
commit 3d06e94595
1 changed files with 3 additions and 3 deletions

View File

@ -63,10 +63,10 @@ class Api::BaseController < ApplicationController
end end
def current_resource_owner def current_resource_owner
return @current_user if doorkeeper_token.nil?
@current_user ||= Rails.cache.fetch("dk:user:#{doorkeeper_token.resource_owner_id}", expires_in: 25.hours) 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) if doorkeeper_token User.find(doorkeeper_token.resource_owner_id)
end end
#@current_user ||= User.find(doorkeeper_token.resource_owner_id) if doorkeeper_token
end end
def current_user def current_user