module Devise::Models::TwoFactorAuthenticatable::ClassMethods

Public Instance Methods

generate_otp_secret(otp_secret_length = self.otp_secret_length) click to toggle source

Geneartes an OTP secret of the specified length, returning it after Base32 encoding.

# 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() click to toggle source

Return value will be splatted with ** so return a version of the encrypted attribute options which is always a Hash. @return [Hash]

# File lib/devise_two_factor/models/two_factor_authenticatable.rb, line 105
def splattable_encrypted_attr_options
  return {} if otp_encrypted_attribute_options.nil?

  otp_encrypted_attribute_options
end