faced with an issue where @user.reset_token returns nil.
app/views/user_mailer/password_reset.html.erb
<%= link_to \"Reset password\", edit_passwo
You're not storing the reset_token
in the database - you're storing the reset_digest
.
When you don't use workers, you're storing the reset_token
in the User instance, then passing that same User instance to your mailer - hence the reset_token
is still available.
When you use workers, your worker only has the User's ID, so it's reloading the User instance from the database. Because the reset_token
isn't being stored in the database, it's coming back nil.
Either you should be saving the reset_token
in the database, or your password email should be using reset_digest
in the URL.