Class: Oauth2Token
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Oauth2Token
show all
- Defined in:
- app/models/oauth2_token.rb
Defined Under Namespace
Classes: AccessToken, AuthorizationCode, RefreshToken
Instance Method Summary
collapse
Instance Method Details
#expire! ⇒ Object
23
24
25
|
# File 'app/models/oauth2_token.rb', line 23
def expire!
update_attribute(:expires_at, Time.now.utc) || raise(ActiveRecord::RecordInvalid)
end
|
#expires_in ⇒ Object
19
20
21
|
# File 'app/models/oauth2_token.rb', line 19
def expires_in
(expires_at - Time.now.utc).to_i
end
|