Module: Devise::Models::TwoFactorAuthenticatable::ClassMethods
- Defined in:
- lib/devise_two_factor/models/two_factor_authenticatable.rb
Instance Method Summary collapse
-
#generate_otp_secret(otp_secret_length = self.otp_secret_length) ⇒ Object
Geneartes an OTP secret of the specified length, returning it after Base32 encoding.
-
#splattable_encrypted_attr_options ⇒ Hash
Return value will be splatted with ** so return a version of the encrypted attribute options which is always a Hash.
Instance Method Details
#generate_otp_secret(otp_secret_length = self.otp_secret_length) ⇒ Object
Geneartes an OTP secret of the specified length, returning it after Base32 encoding.
98 99 100 |
# File 'lib/devise_two_factor/models/two_factor_authenticatable.rb', line 98 def generate_otp_secret(otp_secret_length = self.otp_secret_length) ROTP::Base32.random(otp_secret_length) end |
#splattable_encrypted_attr_options ⇒ Hash
Return value will be splatted with ** so return a version of the encrypted attribute options which is always a Hash.
105 106 107 108 109 |
# File 'lib/devise_two_factor/models/two_factor_authenticatable.rb', line 105 def return {} if .nil? end |