demarches-normaliennes/app/models/trusted_device_token.rb

11 lines
200 B
Ruby
Raw Normal View History

2019-02-01 18:11:55 +01:00
class TrustedDeviceToken < ApplicationRecord
LOGIN_TOKEN_VALIDITY = 45.minutes
2019-02-01 18:11:55 +01:00
belongs_to :gestionnaire
has_secure_token
def token_valid?
LOGIN_TOKEN_VALIDITY.ago < created_at
end
2019-02-01 18:11:55 +01:00
end