trustedDeviceToken: move token youth
This commit is contained in:
parent
23db8a160c
commit
d664f130fd
4 changed files with 22 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue