ruby on rails - Devise 3.1 Upgrade Invalid Token Error -
my app has been using devise (3.1.0, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 2.2.4), current version 3.1.0. upgrade there new way devise token confirmation (blog).
when click on email link leads invalid token error, i'm trying find out how resolve this. please let me know pointers have. thank you.
with 3.1.0, devise has changed way handles token authentication. rather storing unencrypted token in database, devise encrypts token , sends unencrypted token in confirmation email. need set config.secret_key
in order facilitate encryption. more info on here: devise secret key not set
thus, if have old email, or old token in database, not match expect. can set
config.allow_insecure_token_lookup = true
in devise initializer file remedy problem, supposed short-term solution while wait users click on confirmation emails sent out before switch.
lastly, if you've changed mail message reference token directly (e.g. @user.reset_password_token
), using encrypted version in email , need change reference @token
variable defined devise instead. here's example email: https://github.com/plataformatec/devise/blob/2a8d0f9beeb31cd2287094c5dcf843d0bd069eb8/app/views/devise/mailer/reset_password_instructions.html.erb#l5
Comments
Post a Comment