Skip to content

fix: firebase user email actions changed - #244

Merged
Alessandro100 merged 1 commit into
mainfrom
fix/firebase-email-template-reset-password-action-url
Sep 29, 2026
Merged

Alessandro100 merged 1 commit into
mainfrom
fix/firebase-email-template-reset-password-action-url

Conversation

@Alessandro100

@Alessandro100 Alessandro100 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

When a user requested a reset password action, the link coming from the reset password email was not correct
ex: https://mobilitydatabase.org/email-verification?mode=resetPassword&oobCode=y&apiKey=x

This happened because when we changed the action link in the firebase console for the email verification, it auto applied it to all the actions email-verification password-reset

The solution was to include a generic action link /auth/action that will redirect the user to the correct page depending on the mode firebase provides

Expected behavior:

When a user needs to verify their email address or reset their password, the link given to them in the email should succeed

Testing tips:

Important

For the firebase dev environment we use https://mobilitydatabase.org/auth/action because there is no stable dev environment, all you need to do is replace https://mobilitydatabase.org/ with the preview url and it will work. This is the link you will find in the email

  1. Create a new account and verify your email using the link in the email
  2. Once this account is created, log out and do a reset password. Use the link in the email
  3. Login with the new password

To Note
There are 2 more unaccounted firebase actions that we do not have pages for because we do not support them

  • email address change
  • multi factor enrollment

Once this gets merged to production I will change the action urls in firebase console prod

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with yarn test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)
Screenshot 2026-09-28 at 09 58 08 Screenshot 2026-09-28 at 12 53 42 Screenshot 2026-09-28 at 13 05 07

@Alessandro100
Alessandro100 requested a balanced review from Copilot September 28, 2026 17:01
@Alessandro100 Alessandro100 self-assigned this Sep 28, 2026
@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mobilitydatabase-web Ready Ready Preview Sep 28, 2026 5:01pm UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Transient verification failures become terminal, repeated query parameters can cause a 500 response, and the core reset workflow lacks coverage.

Review effort: Balanced
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds a generic Firebase auth-action route that dispatches email verification and password-reset links to localized handlers.

Changes:

  • Adds Firebase action routing with locale resolution and backward compatibility.
  • Implements the password-reset form and error handling.
  • Adds translations and unit tests for routing/error helpers.
  • Applied Vercel React best practices during review.
File Description
ResetPassword.tsx Implements the password-reset workflow.
reset-password/​page.tsx Exposes the reset-password route.
reset-password-errors.ts Maps Firebase reset errors.
reset-password-errors.spec.ts Tests error mapping.
email-verification/​page.tsx Redirects legacy action links.
auth/​action/​page.tsx Adds the generic Firebase action entry point.
auth-actions.ts Resolves action targets and locales.
auth-actions.spec.ts Tests action resolution.
AuthActionError.tsx Displays unsupported-action errors.
messages/​fr.json Adds French translations.
messages/​en.json Adds English translations.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/app/[locale]/auth/action/lib/auth-actions.ts
Comment thread src/app/[locale]/reset-password/ResetPassword.tsx
Comment on lines +71 to +72
try {
const verifiedEmail = await app.auth().verifyPasswordResetCode(oobCode);
@github-actions

Copy link
Copy Markdown

*Lighthouse ran on https://mobilitydatabase-ehwi6nk5b-mobility-data.vercel.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 98 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-ehwi6nk5b-mobility-data.vercel.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 91 🟠 87 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-ehwi6nk5b-mobility-data.vercel.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🔴 43 🟢 94 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-ehwi6nk5b-mobility-data.vercel.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 85 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-ehwi6nk5b-mobility-data.vercel.app/feeds/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 91 🟢 94 🟢 96 🟢 100

@davidgamez davidgamez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Alessandro100
Alessandro100 merged commit 55cb1c7 into main Sep 29, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8e0cdef9 Deployed Sep 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants