Firebase functions update and fix redirect bug#54
Conversation
mafernandag
commented
Oct 23, 2025
- Firebase functions endpoint errors solved
- Solved bug where the user wasn't getting redirected to the "get started" page after successful ORCID sign-up
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a critical ORCID authentication redirect bug and enhances the Firebase Functions implementation with better error handling and diagnostics.
Key Changes:
- Fixed inverted logic preventing new users from reaching the onboarding flow
- Added comprehensive error handling and diagnostics for ORCID API interactions
- Implemented lazy initialization pattern for Express app in Firebase Functions v2
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| mentor-match-app/src/components/auth/OrcidHandler.jsx | Corrected conditional logic to properly redirect new users to '/get-started' and existing users to '/dashboard' |
| mentor-match-app/functions/index.js | Added Node.js version validation, enhanced error handling with detailed diagnostics, implemented lazy Express initialization, and improved ORCID API endpoint validation |
| NODE_ENV: NODE_ENV || 'development' | ||
| }, | ||
| values: { | ||
| ORCID_REDIRECT_URI |
There was a problem hiding this comment.
The diagnostics endpoint exposes the actual ORCID_REDIRECT_URI value without redaction, unlike ORCID_CLIENT_ID and ORCID_CLIENT_SECRET which are redacted. While the redirect URI is less sensitive, exposing it publicly could aid attackers in crafting phishing attempts or understanding the authentication flow. Consider redacting or removing this value from the diagnostics response, or restricting access to this endpoint.
| ORCID_REDIRECT_URI | |
| ORCID_REDIRECT_URI: redact(ORCID_REDIRECT_URI) |
After signing up with ORCID, the user didn't get redirected to the get started page
|
Visit the preview URL for this PR (updated for commit c3b1584): https://mentor-match-backend--pr-54-tn1my1rv.web.app (expires Thu, 30 Oct 2025 21:31:04 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 00dcef695f9e3298930fa589c5484a93e0a376cb |