Files
nairobi/db/migrate/20231009073912_add_lockable_to_devise.rb
taitus a1955531e1 Enable devise lockable module with default values
In order to the display a warn text on the last attempt
before the account is locked, we need update
config.paranoid to false as the devise documentation
explains.

Adding "config.paranoid: false" implies further changes
to the code, so for now we unncomment the default value
"config.last_attempt_warning = true" and update it to false.
2023-10-24 20:20:27 +02:00

12 lines
404 B
Ruby

class AddLockableToDevise < ActiveRecord::Migration[6.1]
def change
# Only if lock strategy is :failed_attempts
add_column :users, :failed_attempts, :integer, default: 0, null: false
add_column :users, :locked_at, :datetime
# Add these only if unlock strategy is :email or :both
add_column :users, :unlock_token, :string
add_index :users, :unlock_token, unique: true
end
end