ChikyuKido / Lehrium

A simple website where you can rate your teachers from untis.
GNU General Public License v3.0
3 stars 0 forks source link

email auth #7

Closed ChikyuKido closed 2 weeks ago

ChikyuKido commented 1 month ago

Create another table "authentication" that contains, uuid, userId, expirationDate. If a user asks for a verification link, create a entry in this table for the user. The link the user receives in their email contains a link that contains the uuid also smth like: frontendUrl/auth/verifyEmail/{uuid}. The backend then provides a endpoint /api/v1/auth/verifyEmail that contains the uuid in the body. For the backend endpoint stick to the docs. The backend then checks if the uuid is valid and is not expired. If its correct, set the flag isUserVerified in the user to true and delete the entry from the authentication table

ChikyuKido commented 2 weeks ago

added in pr #9