Add password reset flow (mailer, API, UI, DB migration, i18n, tests)#161
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
Implements #121 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
password_reset_tokensto store hashed tokens, expiry and usage timestamps (app/lib/db/migrations/018_password_reset_tokens.sqland schema update).app/lib/users.ts, includingrequestPasswordReset,resetPasswordWithToken, token hashing, and reset URL construction based onNEXT_PUBLIC_APP_URL/deployment env fallbacks.app/lib/mailer.tsusingnodemailerthat sends localized reset emails or logs links in non-production environments.POST /api/password-reset/requestandPOST /api/password-reset/confirmto request a reset and apply a token respectively.forgot-passwordpage,reset-passwordpage, and small UI change toAuthFormto surface the "forgot password" action, plus CSS tweaks for success messaging and secondary auth button.en,de,fr,it) with localized strings for the reset flow, updated.env.exampleandREADME.mdwith SMTP and public URL configuration, and widened the proxy matcher to allow unauthenticated access to password-reset and related routes.nodemailerand its types topackage.json/package-lock.json.Testing
tests/app/lib/mailer.test.tsverifying SMTP config, locale content, local logging, and production failure behavior, andtests/app/api/password-reset-route.test.tsverifying the request/confirm endpoint behavior and error masking.vitestfor those files and the added tests passed.Codex Task