Module: Devise::Models::TwilioTwoFactorAuthenticatable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #login_attempts_exceeded? ⇒ Boolean
- #need_two_factor_authentication?(request) ⇒ Boolean
- #send_new_otp_after_login? ⇒ Boolean
- #send_otp_code ⇒ Object
- #verify_otp_code(code) ⇒ Object
Instance Method Details
#login_attempts_exceeded? ⇒ Boolean
14 15 16 |
# File 'lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb', line 14 def login_attempts_exceeded? self.failed_attempts.to_i >= Devise.maximum_attempts end |
#need_two_factor_authentication?(request) ⇒ Boolean
18 19 20 |
# File 'lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb', line 18 def need_two_factor_authentication?(request) self.otp_required_for_login end |
#send_new_otp_after_login? ⇒ Boolean
22 23 24 |
# File 'lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb', line 22 def send_new_otp_after_login? self.otp_required_for_login end |
#send_otp_code ⇒ Object
6 7 8 |
# File 'lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb', line 6 def send_otp_code twilio_client.send_code end |
#verify_otp_code(code) ⇒ Object
10 11 12 |
# File 'lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb', line 10 def verify_otp_code(code) twilio_client.verify_code(code) end |