Repository navigation
feat: add forgot password and reset password pages - #363
Merged
Merged
Conversation
The login page linked to /forgot-password, which did not exist. The forgot page sends a Supabase reset email and shows the same message for every address. The reset page waits for the session from the email link, sets a new password of 8+ characters, and sends the user to /portal.
✅ Deploy Preview for cl-official ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for cl-portal-ucla ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
daniellehonn
approved these changes
Nov 5, 2026
daniellehonn
approved these changes
Nov 5, 2026
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.
Closes #315
The "forgot password?" link on
/loginopened a 404. This adds the two missing pages. Both are adapted fromorigin/new_auth_pages(e79e006), which was never tested, with the fixes below./forgot-password: one email field. It callssupabase.auth.resetPasswordForEmailwithredirectToset to${window.location.origin}/reset-password. It shows the same "if an account exists…" message whether or not the email has an account, and only logs Supabase errors to the console./reset-password: the browser client (PKCE) swaps the?code=from the email link for a session when the page loads. The page waits for that withgetSession(), then shows either the form or an "invalid or expired" message with a link to request a new one. The new password must be 8+ characters (same rule as signup) and both fields must match. It saves withsupabase.auth.updateUser({ password }), signs out every other session withsignOut({ scope: "others" }), then goes to/portal.window.location.originis used on purpose instead ofNEXT_PUBLIC_SITE_URL. The PKCE verifier is stored in that site's cookies, so the link only works if it returns to the same site the request came from. That's also why previews work without extra config.Supabase config
Redirect URLs allow list (Auth → URL Configuration):
https://portal.creativelabsucla.com/**(already present, covers production)https://*--cl-portal-ucla.netlify.app/**(deploy previews + branch deploy)http://localhost:3000/**(local)Testing
tscandeslintare clean on the new files./forgot-passwordand/reset-passwordload (200)./portal, log out, and log back in with the new password.portal.creativelabsucla.comafter merge.Known limit: the email link has to be opened in the same browser that requested it, because of the PKCE flow. Otherwise the page shows the "invalid or expired" message.