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

Instance Method Details

#login_attempts_exceeded?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/devise_twilio_two_factor/models/twilio_two_factor_authenticatable.rb', line 14

def 
  self.failed_attempts.to_i >= Devise.maximum_attempts
end

#need_two_factor_authentication?(request) ⇒ Boolean

Returns:

  • (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.
end

#send_new_otp_after_login?Boolean

Returns:

  • (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.
end

#send_otp_codeObject



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