trustedDeviceToken: move token youth

This commit is contained in:
simon lehericey 2019-02-04 11:04:55 +01:00
parent 23db8a160c
commit d664f130fd
4 changed files with 22 additions and 6 deletions

View file

@ -1,5 +1,6 @@
class TrustedDeviceToken < ApplicationRecord
LOGIN_TOKEN_VALIDITY = 45.minutes
LOGIN_TOKEN_YOUTH = 15.minutes
belongs_to :gestionnaire
has_secure_token
@ -7,4 +8,8 @@ class TrustedDeviceToken < ApplicationRecord
def token_valid?
LOGIN_TOKEN_VALIDITY.ago < created_at
end
def token_young?
LOGIN_TOKEN_YOUTH.ago < created_at
end
end