class Capcoauth::OAuth::TTLCache

Public Class Methods

key_for(access_token) click to toggle source
# File lib/capcoauth/oauth/ttl_cache.rb, line 17
def self.key_for(access_token)
  "capcoauth_token:#{access_token}"
end
remove(access_token) click to toggle source
# File lib/capcoauth/oauth/ttl_cache.rb, line 13
def self.remove(access_token)
  store.delete(key_for(access_token))
end
store() click to toggle source
# File lib/capcoauth/oauth/ttl_cache.rb, line 21
def self.store
  Capcoauth.configuration.cache_store
end
update(access_token, user_id) click to toggle source
# File lib/capcoauth/oauth/ttl_cache.rb, line 9
def self.update(access_token, user_id)
  store.write(key_for(access_token), user_id, expires_in: Capcoauth.configuration.token_verify_ttl)
end
user_id_for(access_token) click to toggle source
# File lib/capcoauth/oauth/ttl_cache.rb, line 5
def self.user_id_for(access_token)
  store.fetch(key_for(access_token))
end