HotFix: Fix Debug Auth Bug#15
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the debug-mode Firebase authentication flow so debug builds don’t access Firebase/cloud services unless explicitly configured with a custom token, and documents the new behavior to reduce accidental cloud usage during development.
Changes:
- Reworked debug auth to require
VITE_DEBUG_FIREBASE_CUSTOM_TOKEN(removing anonymous sign-in) and sign in viasignInWithCustomToken. - Updated Firebase feature-flag evaluation to disable Firebase in debug mode when no debug custom token is configured (with a dev-only warning).
- Refreshed documentation and examples to reflect “local-only unless token is set” behavior.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/shared/firebase/DebugAuthProvider.tsx |
Removes anonymous debug sign-in and requires a custom token for debug sessions. |
src/shared/features/featureFlags.ts |
Disables Firebase in debug mode unless a debug custom token is present; adds warning. |
docs/FIREBASE.md |
Documents the new debug-only custom token requirement and flow. |
AGENTS.md |
Updates internal contributor notes to match new debug auth behavior. |
.env.local.example |
Clarifies that debug Firebase requires a custom token; blank keeps debug local-only. |
.gitignore |
Ignores /scripts/emergency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This pull request updates the debug-mode Firebase authentication flow to require a custom token for cloud access, ensuring that debug builds are local-only unless explicitly configured. It also improves documentation and adds a feature flag check to prevent accidental cloud access during development.
Debug Firebase authentication changes:
src/shared/firebase/DebugAuthProvider.tsx: Refactored to remove anonymous sign-in; debug mode now only signs in withVITE_DEBUG_FIREBASE_CUSTOM_TOKENfor fixed uidDEBUGGER. If no token is set, Firebase/cloud features are disabled in debug mode. [1] [2]src/shared/features/featureFlags.ts: Added a check inisFirebaseEnabled()to disable Firebase in debug mode unless a custom token is provided, with a warning in the console.Documentation updates:
.env.local.example: Clarified thatVITE_DEBUG_FIREBASE_CUSTOM_TOKENis required for debug mode Firebase and that leaving it blank keeps debug builds local-only.docs/FIREBASE.md: Updated to reflect that debug Firebase is local-only/off unless a custom token is set, and clarified the authentication flow in debug mode.AGENTS.md: Updated the description ofDebugAuthProviderto match the new behavior—debug mode only signs in with a custom token, otherwise disables cloud features.