move token validity to trusted_device_token
This commit is contained in:
parent
b9b83cca3a
commit
23db8a160c
5 changed files with 26 additions and 29 deletions
|
@ -1,4 +1,10 @@
|
|||
class TrustedDeviceToken < ApplicationRecord
|
||||
LOGIN_TOKEN_VALIDITY = 45.minutes
|
||||
|
||||
belongs_to :gestionnaire
|
||||
has_secure_token
|
||||
|
||||
def token_valid?
|
||||
LOGIN_TOKEN_VALIDITY.ago < created_at
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue