Module: Devise::Oauth2Providable::ExpirableToken::LocalInstanceMethods

Defined in:
lib/devise/oauth2_providable/expirable_token.rb

Instance Method Summary collapse

Instance Method Details

#expired!Object

forcefully expire the token



38
39
40
41
# File 'lib/devise/oauth2_providable/expirable_token.rb', line 38

def expired!
  self.expires_at = Time.now.utc
  self.save!
end

#expires_inObject

number of seconds until the token expires



33
34
35
# File 'lib/devise/oauth2_providable/expirable_token.rb', line 33

def expires_in
  (expires_at.utc - Time.now.utc).to_i
end