How to make Devise lockable with number of failed attempts

后端 未结 2 945
眼角桃花
眼角桃花 2020-12-05 00:17

Using Devise 2.1.2 and Rails 3.2.6

I\'m doing this Q&A just in case others run into this problem because I found little and scattered documentation for it.

2条回答
  •  鱼传尺愫
    2020-12-05 00:41

    Simply uncomment this strings in devise migration:

      ## Lockable
      # t.integer  :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
      # t.string   :unlock_token # Only if unlock strategy is :email or :both
      # t.datetime :locked_at
    

提交回复
热议问题