0

When I create a new record and send password reset email. The link of that gives me this error

reset password token is invalid devise rails

My model is

class Advertiser < ActiveRecord::Base
devise :database_authenticatable, :registerable,
     :recoverable, :rememberable, :trackable, :validatable

after_create { |admin| admin.send_reset_password_instructions }
def password_required?
  new_record? ? false : super
end

end

Basically I create new advertiser from activeadmin without giving password. Only in this scenario that issue came.Otherwise it works fine.

Link genereate is like that

http://localhost:3000/admin/password/edit?reset_password_token=fDxVmCNjKNDiUseWGLe6

BUt it gives error like that

Reset password token is invalid

1 Answers1

0

See this solution.

Rails 4 + Devise: Password Reset is always giving a "Token is invalid" error on the production server, but works fine locally.

Check and see if your token in the DB is the same as the one in the email. Devise is using hashes for tokens and you might be getting the hashed version.

Community
  • 1
  • 1
Mariah
  • 62
  • 5