Class: G5AuthenticatableApi::Services::UserFetcher

Inherits:
TokenInfo
  • Object
show all
Defined in:
lib/g5_authenticatable_api/services/user_fetcher.rb

Instance Attribute Summary

Attributes inherited from TokenInfo

#headers, #params, #warden

Instance Method Summary collapse

Methods inherited from TokenInfo

#access_token, #auth_client, #initialize, #token_data

Constructor Details

This class inherits a constructor from G5AuthenticatableApi::Services::TokenInfo

Instance Method Details

#current_userObject



6
7
8
9
10
11
12
# File 'lib/g5_authenticatable_api/services/user_fetcher.rb', line 6

def current_user
  if access_token == @warden.try(:user).try(:g5_access_token)
    @warden.user
  else
    auth_client.me
  end
end