Skip to content

HotFix: Fix Debug Auth Bug#15

Merged
kiyarose merged 2 commits into
mainfrom
hf/DEBUGGANIZE
May 24, 2026
Merged

HotFix: Fix Debug Auth Bug#15
kiyarose merged 2 commits into
mainfrom
hf/DEBUGGANIZE

Conversation

@kiyarose
Copy link
Copy Markdown
Member

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 with VITE_DEBUG_FIREBASE_CUSTOM_TOKEN for fixed uid DEBUGGER. If no token is set, Firebase/cloud features are disabled in debug mode. [1] [2]
  • src/shared/features/featureFlags.ts: Added a check in isFirebaseEnabled() to disable Firebase in debug mode unless a custom token is provided, with a warning in the console.

Documentation updates:

  • .env.local.example: Clarified that VITE_DEBUG_FIREBASE_CUSTOM_TOKEN is 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 of DebugAuthProvider to match the new behavior—debug mode only signs in with a custom token, otherwise disables cloud features.

@kiyarose kiyarose requested a review from Copilot May 24, 2026 21:30
@kiyarose kiyarose self-assigned this May 24, 2026
@kiyarose kiyarose added bug Something isn't working help wanted Extra attention is needed labels May 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 via signInWithCustomToken.
  • 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.

Comment thread src/shared/firebase/DebugAuthProvider.tsx
Comment thread src/shared/features/featureFlags.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kiyarose kiyarose enabled auto-merge May 24, 2026 21:34
@kiyarose kiyarose merged commit 3090b57 into main May 24, 2026
1 check passed
@kiyarose kiyarose deleted the hf/DEBUGGANIZE branch May 24, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants