Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete password reset token when the link is clicked #82

Open
CodingMarco opened this issue May 19, 2021 · 1 comment
Open

Delete password reset token when the link is clicked #82

CodingMarco opened this issue May 19, 2021 · 1 comment

Comments

@CodingMarco
Copy link
Collaborator

I would say a password reset token should be deleted as soon as the user clicks on the link in the email, not when the password is actually set. This would prevent tokens from building up in the database.

@Bennik2000
Copy link
Owner

When I implemented this function I explicitly decided to delete the token after the password was set.

Deleting the token as soon as the user clicks on the link means that the site can be accessed only once. Meaning that a refresh of the page is not possible.

One possibility to prevent having not needed tokens in the database would be to add an expiration date to tokens. This means that the link will be valid for e.g. 24 hours maximum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants