Sha256: fd658ea01ed6f777074ccbc825df2455d4c71e46c29759ddc015271a905c09fe

Contents?: true

Size: 1.85 KB

Versions: 6

Compression:

Stored size: 1.85 KB

Contents

module DeviseTwoFactorable
  autoload :Hooks,   'devise_two_factorable/hooks'
  autoload :Mapping, 'devise_two_factorable/mapping'

  module Controllers
    autoload :Helpers,    'devise_two_factorable/controllers/helpers'
    autoload :UrlHelpers, 'devise_two_factorable/controllers/url_helpers'
  end
end

require 'devise-2fa/version'
require 'active_support'
require 'active_support/core_ext'
require 'active_support/core_ext/integer'
require 'active_support/core_ext/string'
require 'active_support/ordered_hash'
require 'active_support/concern'
require 'devise_two_factorable/routes'
require 'devise_two_factorable/engine'
require 'devise'

module Devise
  #
  #
  #
  mattr_accessor :otp_mandatory
  @@otp_mandatory = false

  #
  #
  #
  mattr_accessor :otp_authentication_timeout
  @@otp_authentication_timeout = 3.minutes

  #
  #
  #
  mattr_accessor :otp_recovery_tokens
  @@otp_recovery_tokens = 10 ## false to disable

  #
  # If the user is given the chance to set his browser as trusted, how long will it stay trusted.
  # set to nil/false to disable the ability to set a device as trusted
  #
  mattr_accessor :otp_trust_persistence
  @@otp_trust_persistence = 30.days

  #
  #
  #
  mattr_accessor :otp_drift_window
  @@otp_drift_window = 3 # in minutes

  #
  # if the user wants to change Otp settings,
  # ask the password (and the token) again if this time has passed since the last
  # time the user has provided valid credentials
  #
  mattr_accessor :otp_credentials_refresh
  @@otp_credentials_refresh = 15.minutes # or like 15.minutes, false to disable

  #
  # the name of the token issuer
  #
  mattr_accessor :otp_issuer
  @@otp_issuer = Rails.application.class.parent_name

  module TwoFactor
  end
end

Devise.add_module :two_factorable,
                  controller: :tokens,
                  model: 'devise_two_factorable/models/two_factorable', route: :token

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devise-2fa-0.4.1 lib/devise-2fa.rb
devise-2fa-0.4.0 lib/devise-2fa.rb
devise-2fa-0.2.1 lib/devise-2fa.rb
devise-2fa-0.2.0 lib/devise-2fa.rb
devise-2fa-0.1.1 lib/devise-2fa.rb
devise-2fa-0.1.0 lib/devise-2fa.rb