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

Prevent Duplicate Email Signups and Implement Token TTL #461

Open
gaurav-jo1 opened this issue Oct 10, 2024 · 0 comments
Open

Prevent Duplicate Email Signups and Implement Token TTL #461

gaurav-jo1 opened this issue Oct 10, 2024 · 0 comments
Labels
backend Feature requests for the backend code debt Things to do to work down code debt

Comments

@gaurav-jo1
Copy link
Contributor

gaurav-jo1 commented Oct 10, 2024

Description:

Currently, users can flood the database by repeatedly signing up with the same email address, causing unnecessary database entries and potential abuse.

Screenshot from 2024-10-11 00-58-33

There is a need for a mechanism to check if a token for the same email already exists before generating a new one.

Also, implementing a TTL (Time to Live) for tokens would ensure that unused tokens are cleaned up after a specified period.

Backend:

  • Reuse the remove_existing_token_for_email function to check for and handle existing tokens before issuing a new one.
  • Implement a TTL for the token in the database to ensure that tokens automatically expire after a set time (e.g., 15-30 minutes).

Frontend:

  • Add a loading spinner on the signup button to indicate that the signup request is being processed.
  • Disable the signup button after the request is made to prevent multiple submissions.

"Here's how it looks after implementing the remove_existing_token_for_email function."

Screencast.from.2024-10-11.01-20-04.webm
@codekansas codekansas added backend Feature requests for the backend code debt Things to do to work down code debt labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Feature requests for the backend code debt Things to do to work down code debt
Projects
None yet
Development

No branches or pull requests

2 participants