Sha256: dc9e9977d9bedddb51e9bbeebf1efaa5cc37767b69bb7be059f297ea9d0a3be2

Contents?: true

Size: 326 Bytes

Versions: 2

Compression:

Stored size: 326 Bytes

Contents

require 'g5_authenticatable_api/services/token_info'

module G5AuthenticatableApi
  module Services
    class UserFetcher < TokenInfo
      def current_user
        if access_token == @warden.try(:user).try(:g5_access_token)
          @warden.user
        else
          auth_client.me
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_authenticatable_api-0.4.1 lib/g5_authenticatable_api/services/user_fetcher.rb
g5_authenticatable_api-0.4.0 lib/g5_authenticatable_api/services/user_fetcher.rb