Skip to content

feat: user api integration + sign in / sign up flow fix#145

Merged
Alessandro100 merged 14 commits into
mainfrom
feat/139-user-api-integration
Jun 9, 2026
Merged

feat: user api integration + sign in / sign up flow fix#145
Alessandro100 merged 14 commits into
mainfrom
feat/139-user-api-integration

Conversation

@Alessandro100

@Alessandro100 Alessandro100 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

closes #139

Summary:

  • Integrates the new user-service api
  • Consolidates the sign up / sign in logic into a shared component
  • New e2e tests (mainly for sign up / sign flow)
  • Ability to edit user profile

Expected behavior:

  • When signing up or logging in from the 'notification' subscription button or the 'contribute' page, you should be take through the entire flow of log in before going back to the intended page
  • You should be able to edit your profile
  • The user data will now come from the user-service api and not firebase

Testing tips:

Login / Signup

  • Test the login / signup flow from the add feed form, or the notification button (oauth and email / password)

Account

  • Go on your account profile and edit your account

Follow up tickets

  • Put a blocker on the notification button and add feed form if the user's email is not verified
  • Revisit the route guards for verify-email and complete-registration
  • Touch up the styling of the sign in / sign up / complete-registration page (basic)
  • Be able to generate the user-service types from artifacts (like we do with feeds api)
  • Add the "plugin:react-hooks/recommended" eslint rule

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)
image

@Alessandro100 Alessandro100 requested a review from Copilot June 4, 2026 19:28
@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
mobilitydatabase-web Ready Ready Preview, Comment Jun 5, 2026 12:52pm

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.

Pull request overview

custom: Applied vercel-react-best-practices.

This PR migrates user profile data from Firebase callables to the new user-service REST API, centralizes post-auth redirect logic across sign-in/sign-up/verify-email/complete-registration screens, and adds UI + E2E coverage for editing user profiles and the full registration flow.

Changes:

  • Add user-service OpenAPI schema + generated types and integrate /v1/user GET/PUT into the profile service.
  • Introduce a shared useRegistrationFlowRedirect hook and update auth/registration pages to use it.
  • Add account profile editing (save flow + UI loading/toast feedback) and expand Cypress E2E coverage for sign-in, sign-up flow, and account editing.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/app/types.ts Adds action type constant for saving user profile.
src/app/store/saga/profile-saga.ts Adds saga to persist profile edits via the user-service API.
src/app/store/saga/auth-saga.ts Enhances sign-up flow to fetch user-service profile data after Firebase sign-up.
src/app/store/profile-selectors.ts Adds selector for save-user-profile status.
src/app/store/profile-reducer.ts Adds reducers/state for profile save lifecycle (loading/success/fail/reset).
src/app/services/user-service-api-types.ts Adds generated OpenAPI types for the user-service API.
src/app/services/profile-service.ts Replaces Firebase callable profile read/write with /v1/user GET/PUT.
src/app/hooks/useRegistrationFlowRedirect.ts New centralized redirect logic for the multi-step registration flow.
src/app/hooks/index.ts Re-exports the new registration redirect hook.
src/app/[locale]/verify-email/PostRegistration.tsx Uses the new redirect hook instead of per-page redirect effect.
src/app/[locale]/verify-email/page.tsx Temporarily removes auth/status wrapper around verify-email page.
src/app/[locale]/sign-up/SignUp.tsx Uses shared redirect hook; removes duplicated redirect effect.
src/app/[locale]/sign-in/SignIn.tsx Uses shared redirect hook; removes duplicated redirect effect.
src/app/[locale]/complete-registration/page.tsx Temporarily removes auth/status wrapper around complete-registration page.
src/app/[locale]/complete-registration/CompleteRegistration.tsx Uses shared redirect hook; removes duplicated redirect effect.
src/app/[locale]/account/AccountSectionContainer.tsx Adds optional loading indicator to account section container.
src/app/[locale]/account/AccountGeneral.tsx Adds profile edit/save UI, status toasts, and dispatches save actions.
package.json Adds scripts to generate user-service API types from OpenAPI YAML.
external_types/UserServiceAPI.yaml Adds user-service OpenAPI spec (profile + notifications/subscriptions).
external_types/BearerTokenSchema.yaml Adds shared bearer auth schema referenced by the user-service spec.
cypress/support/index.ts Declares new Cypress command for Firebase-only user creation.
cypress/support/commands.ts Implements createNewFirebaseUser helper for E2E flows controlling Redux directly.
cypress/e2e/signup.cy.ts Adds E2E coverage for full verify-email → complete-registration → redirect flow.
cypress/e2e/signin.cy.ts Adds E2E coverage for post-login redirect behaviors.
cypress/e2e/accountGeneral.cy.ts Adds E2E coverage for account profile editing and error flows.

Comment thread src/app/services/profile-service.ts Outdated
Comment thread src/app/services/profile-service.ts
Comment thread src/app/[locale]/verify-email/page.tsx
Comment thread src/app/[locale]/complete-registration/page.tsx Outdated
Comment thread src/app/[locale]/account/AccountGeneral.tsx
Comment thread cypress/e2e/accountGeneral.cy.ts
Comment thread cypress/e2e/accountGeneral.cy.ts
Comment thread src/app/[locale]/account/AccountGeneral.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

Performance Accessibility Best Practices SEO
🟠 83 🟢 94 🟢 96 🟢 100

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

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

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

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

*Lighthouse ran on https://mobilitydatabase-330zywy8m-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
🟠 87 🟠 84 🟢 96 🟢 100

*Lighthouse ran on https://mobilitydatabase-330zywy8m-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
🟠 74 🟢 94 🟢 96 🟢 100

sx={{ mt: 1 }}
>
Change Password
{t('changePassword')}

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.

👍

@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!
I'll leave it to @emmambd to review the UX flow

<ProtectedPageWrapper targetStatus='unverified'>
<PostRegistration />
</ProtectedPageWrapper>
{/* TODO: Revisit protected page wrappers. This page changes the status of the user which causes flickers of mismatched authentication */}

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.

👍 Let's create an issue to be able to follow-up

@emmambd

emmambd commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Tested subscribing to notifications and going to the contribute page signed out - both flows worked.

I could edit my name, my organization, and my email consent without issue. LGTM!

@Alessandro100 Alessandro100 merged commit d408ed9 into main Jun 9, 2026
4 checks passed
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.

[web]: Generate user API schema and integrate

4 participants