Class: Booth::Models::Onboarding
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Booth::Models::Onboarding
- Defined in:
- lib/booth/models/onboarding.rb
Overview
Log in via a special URL, forcing you to delete all your existing authenticators.
Instance Method Summary collapse
- #consumed? ⇒ Boolean
-
#lifespan ⇒ Object
Distinguish “first time onboarding” from high-stakes “I lost my authenticator”.
- #timed_out? ⇒ Boolean
Instance Method Details
#consumed? ⇒ Boolean
29 30 31 |
# File 'lib/booth/models/onboarding.rb', line 29 def consumed? consumed_at.present? end |
#lifespan ⇒ Object
Distinguish “first time onboarding” from high-stakes “I lost my authenticator”.
21 22 23 24 25 26 27 |
# File 'lib/booth/models/onboarding.rb', line 21 def lifespan if credential.authenticators.any? 12.hours else 1.week end end |
#timed_out? ⇒ Boolean
33 34 35 |
# File 'lib/booth/models/onboarding.rb', line 33 def timed_out? created_at < lifespan.ago end |