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