Django-Verify-Email
Django-Verify-Email copied to clipboard
Verification link always invalid when trying to register again with the same email address
Issue is on this line: https://github.com/foo290/Django-Verify-Email/blob/95b653a260bc1f97149967e016bb46e816f9f3e2/verify_email/token_manager.py#L147
When you register using an unused email, everything works perfectly. The issue arises when you register again using the same email address, which is allowed by default in Django. This results in the first item getting picked, which is the one created earlier. The verification token will not match and you'll land on an error page. Maybe it's a good idea to sort by date_joined to prevent this from wrongly happening?