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

Email verification #49

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Email verification #49

wants to merge 11 commits into from

Conversation

mattrltrent
Copy link
Member

Summary

Allows users to register up to 2 email addresses with their account, a "personal" and "school" address. If a user registers a valid "school" address, this renders their account verified (so we can give them a badge for being a confirmed student). Also grants the ability for users to switch which of these two addresses is their "primary" contact address, and also to delete either of these addresses.

Currently doesn't actually send emails to the addresses to verify; the routes just return the token link directly. These links that GET /verify-unlink/{token}/ and GET /verify-link/{token}/ return are meant to be opened in the browser, so they return HTML.

New changes

  • Adds route GET /verify-link to fetch a link that allows for linking a new email to a user's account.
  • Adds route GET /verify-unlink to fetch a link that allows for unlinking an email from a user's account.
  • Adds route PUT /email to change the user's preferred "primary" email address.
  • Adds route GET /verify-link/{token}/ designed to be opened from an email inbox that links an email to a user's account. Route should handle the link received initially from GET /verify-link.
  • Adds route GET /verify-unlink/{token}/ designed to be opened from an email inbox that unlinks an email from a user's account. Route should handle the link received initially from GET /verify-unlink.
  • Added openapi.yaml docs for all new routes.

Old changes

  • Updated GET /users/profile/ to also include information about a user's email verification status, alongside their specific emails.
  • Updated old openapi.yaml docs for GET /users/profile/ to reflect the most recent changes to the route.

Notes

  • Based on what was said in Discord, are JWTs valid for this use case?
  • Currently the routes that accept tokens are GET requests, even though they are linking/unlinking email addresses for the user's account. They're labeled this way because browsers do GET requests, and they're meant to be clicked on and opened in a browser. Maybe this needs to be changed?
  • Mostly closes Email verification #48 (everything without the actual sending of emails).

@mattrltrent mattrltrent added the feature Something to be added or improved upon. label Apr 12, 2023
@mattrltrent mattrltrent requested a review from minitech April 12, 2023 01:55
@mattrltrent mattrltrent self-assigned this Apr 12, 2023
@gitguardian
Copy link

gitguardian bot commented Apr 12, 2023

⚠️ GitGuardian has uncovered 2 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id Secret Commit Filename
4843458 Generic High Entropy Secret 4b8197a .env View secret
4843458 Generic High Entropy Secret e10fd81 .env View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something to be added or improved upon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email verification
1 participant