Sha256: e26c4ba9994c94a9dbe4ee663fba6bd13f061f2358293d2689cb7c8a0ce52373
Contents?: true
Size: 592 Bytes
Versions: 14
Compression:
Stored size: 592 Bytes
Contents
module TokenAuthenticateMe class Authentication def self.default_token_handler(token, _options) session = TokenAuthenticateMe::Session.find_by_key(token) if session && session.expiration > DateTime.now session else false end end attr_reader :token, :token_handler def initialize(token:, token_handler: TokenAuthenticateMe::Authentication.method(:default_token_handler)) @token = token @token_handler = token_handler end def authenticate(options = {}) token_handler.call(token, options) end end end
Version data entries
14 entries across 14 versions & 1 rubygems