Coltensiemer / AWS_Learn

An AWS Quiz maker to practice for the AWS Cloud Certifications.
https://aws-learn.vercel.app
1 stars 0 forks source link

One time URLS for quiz #10

Open Coltensiemer opened 1 month ago

Coltensiemer commented 1 month ago

GitHub Issue: Enhancement - Implement One-Time URL for Quiz Page

Title:

Enhancement: Implement One-Time URL for Secure Quiz Access

Description:

To enhance the security and user experience of our quiz application, we propose the implementation of a one-time URL system for accessing the quiz page. This feature will generate unique, single-use URLs that ensure only authorized users can access the quiz and prevent any unauthorized or repeat access.

Feature Details:

  1. Generate One-Time URL:

    • Create a function to generate a unique token.
    • Append this token to the quiz URL.
    • Store the token with associated user data and expiration time in the database.
    • Allow so it does not generator the one time url during development.
  2. Send URL to User:

    • Implement a mechanism to send the one-time URL to the user's registered email address.
  3. Validate URL on Access:

    • On quiz page access, check the token in the URL.
    • Verify if the token exists in the database, is associated with the correct user, and is not expired or already used.
  4. Invalidate URL after Use:

    • Mark the token as used or remove it from the database after the quiz is accessed.
  5. Expiration Handling:

    • Set a configurable expiration time for the one-time URL.
    • Provide appropriate feedback to users attempting to use an expired or invalid URL.

Benefits:

Tasks:

  1. Backend:

    • [ ] Create an endpoint to generate one-time URLs.
    • [ ] Store tokens with expiration times in the database.
    • [ ] Validate tokens on quiz access.
  2. Frontend:

    • [ ] Update the quiz page to accept and process one-time URLs.
    • [ ] Provide user feedback for invalid or expired URLs.
    • [ ] Forward invalid or expired URLS to an error page.
  3. Email Integration:

    • [ ] Implement email sending functionality to distribute the one-time URL.
  4. Testing:

    • [ ] Write unit and integration tests for URL generation, validation, and expiration handling.
    • [ ] Ensure secure handling and storage of tokens.

Additional Information:

Implementing a one-time URL system will significantly improve the security and functionality of our quiz application. This enhancement aligns with our commitment to providing a secure and seamless user experience.

Labels:


Feel free to add any additional comments or suggestions to this issue. Let's collaborate to make our quiz application more secure and user-friendly!