Devise Account Unlock Returning “Unlock Token is I

2019-04-23 13:56发布

问题:

I have a standard devise implementation. Everything is working except for account unlocking (locking works fine).

I can unlock accounts in the console using unlock_access!. I can also locate the account using User.find_by_unlock_token. However, UnlocksController#show - specifically, resource_class.unlock_access_by_token(params[:unlock_token]) - returns an "Unlock token is invalid" error.

Any help would be be much appreciated. Thanks!

回答1:

This was a problem with a missed update to Devise. In the mailer template, @resource.unlock_token changed to @token. Works!