Devise: manually encrypt password and store directly

前端 未结 5 947
[愿得一人]
[愿得一人] 2021-02-01 02:27

I\'m trying to migrate a ton of users from an old database. To do this, I\'m using activerecord-import and trying to save all my user data directly to DB (bypassing the User mo

5条回答
  •  滥情空心
    2021-02-01 02:58

    None of the other answers above worked for me, so here is what I did:

    user.valid_password?(plain_password)

    https://github.com/plataformatec/devise/blob/d293e00ef5f431129108c1cbebe942b32e6ba616/lib/devise/models/database_authenticatable.rb#L44

提交回复
热议问题