devise icon indicating copy to clipboard operation
devise copied to clipboard

Unable to resend confirmation instructions with the same activation link

Open efmiglioranza opened this issue 12 years ago • 2 comments

As Devise 3.1 now stores digest tokens in the database, the user.confirmation_token is no longer usable to create confirmation links by hand. Although it's a security measure (to reset the token for each activation link created through Devise), it invalidates the old links.

The problem now is that some users are confused, as some of them try to resend the confirmation e-mail many times, each time invalidating the previous one. As they get one in their e-mail box, it's no longer valid. Usually, after two attempts they simple leave, without opening the last one that would really do the job.

Also, I used to send follow-up e-mails and if the user hadn't confirmed yet, I'd append the link in the follow-up. Now, this is no longer possible, as I can't access the @token after the confirmation e-mail is sent.

It'd be nice to have a way to retrieve the same confirmation link, or at least, don't invalidate the old ones, but I don't know yet if this is possible with this new token architecture. Any ideas?

efmiglioranza avatar Feb 27 '14 12:02 efmiglioranza

You could:

  • Create an array/a database table of tokens.
  • In your follow-up email use the encrypted token. Then encrypt the encrypted token again. Now, the first email has a token that has to be encrypted twice to be valid and the follow-up email has a token that has to be encrypted once to be valid. This logic could quickly get out of hand though. And I'm not sure of how safe this is.

None of these solutions seem to be trivial to implement with Devise though.

guilhermesimoes avatar Feb 28 '14 13:02 guilhermesimoes

Hi @efmiglioranza!

Thanks for reporting, but unfortunately there is no way to make this work due to the security concern it has to deal with (as described here in the token section).

One thing you could do is explain to the users what is the right thing to do in this situation. Thanks!

laurocaetano avatar Apr 11 '14 18:04 laurocaetano