13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/generators/mongoid/devise_two_factor_generator.rb', line 13
def migration_data
<<RUBY
# Devise TwoFactor
field :encrypted_otp_auth_secret, type: String, encrypted: true
field :encrypted_otp_recovery_secret, type: String, encrypted: true
field :otp_enabled, type: Boolean, default: false
field :otp_mandatory, type: Boolean, default: false
field :otp_enabled_on, type: DateTime
field :otp_failed_attempts, type: Integer, default: 0
field :otp_recovery_counter, type: Integer, default: 0
field :otp_persistence_seed, type: String
field :otp_session_challenge, type: String
field :otp_challenge_expires, type: DateTime
index({ otp_session_challenge: 1 }, background: true)
index({ otp_challenge_expires: 1 }, background: true)
RUBY
end
|