Devise password reset from Rails console

后端 未结 8 964
梦毁少年i
梦毁少年i 2021-01-30 01:38

While running an app how do you select a user by email address and then set the password manually within rails console for Devise?

Also, where would I go to

相关标签:
8条回答
  • 2021-01-30 02:09

    Modern devise allows simpler syntax, no need to set the confirmation field

    user.password = new_password; user.save
    # or
    user.update(password: new_password)
    
    0 讨论(0)
  • 2021-01-30 02:11

    If your account is locked from too many login attempts, you may also need to do:

    user.locked_at = ''
    user.failed_attempts = '0'
    user.save!
    
    0 讨论(0)
提交回复
热议问题