Module: Devise::Models::TwoFactorAuthenticatable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/two_factor_authentication/models/two_factor_authenticatable.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
- #generate_two_factor_code ⇒ Object
- #max_login_attempts? ⇒ Boolean
- #need_two_factor_authentication? ⇒ Boolean
- #send_two_factor_authentication_code(code) ⇒ Object
Instance Method Details
#generate_two_factor_code ⇒ Object
15 16 17 |
# File 'lib/two_factor_authentication/models/two_factor_authenticatable.rb', line 15 def generate_two_factor_code self.class.login_code_random_pattern.gen end |
#max_login_attempts? ⇒ Boolean
23 24 25 |
# File 'lib/two_factor_authentication/models/two_factor_authenticatable.rb', line 23 def max_login_attempts? second_factor_attempts_count >= self.class.max_login_attempts end |
#need_two_factor_authentication? ⇒ Boolean
11 12 13 |
# File 'lib/two_factor_authentication/models/two_factor_authenticatable.rb', line 11 def need_two_factor_authentication? true end |
#send_two_factor_authentication_code(code) ⇒ Object
19 20 21 |
# File 'lib/two_factor_authentication/models/two_factor_authenticatable.rb', line 19 def send_two_factor_authentication_code(code) p "Code is #{code}" end |