class TfaSession
Form object for handling two-factor authentication sessions
Automatically generated by the orthodox gem (github.com/katanacode/orthodox) © Copyright 2019 Katana Code Ltd. All Rights Reserved.
Constants
- OTP_FORMAT
Regex for OTP format
- RECOVERY_CODE_FORMAT
Regex for recovery code format
Public Instance Methods
otp?()
click to toggle source
recovery_code?()
click to toggle source
# File lib/generators/authentication/templates/models/tfa_session.rb, line 55 def recovery_code? recovery_code.present? end
Private Instance Methods
otp_correct()
click to toggle source
recovery_code_correct()
click to toggle source
# File lib/generators/authentication/templates/models/tfa_session.rb, line 71 def recovery_code_correct unless record.valid_recovery_code?(recovery_code.to_s) errors.add(:base, "Recovery code was not correct") end end