Skip to content

Commit

Permalink
Disable Firebase Emulator in Production
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCode92 committed Jan 8, 2025
1 parent 0623180 commit 94f813f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
import firebaseApp from "@/config/firebase";

const FIREBASE_AUTH_EMULATOR = import.meta.env.VITE_FIREBASE_AUTH_EMULATOR_HOST;
const CI = import.meta.env.CI; // Always set to true in GitHub Actions

const googleAuthProvider = new GoogleAuthProvider();

Expand All @@ -29,7 +30,7 @@ googleAuthProvider.setCustomParameters({
export const auth = getAuth(firebaseApp);
export const db = getFirestore();

if (FIREBASE_AUTH_EMULATOR) {
if (CI !== "true" && FIREBASE_AUTH_EMULATOR) {
console.warn(`Using Firebase Auth Emulator on ${FIREBASE_AUTH_EMULATOR}...`);
connectAuthEmulator(auth, "http://" + FIREBASE_AUTH_EMULATOR);
connectFirestoreEmulator(db, "localhost", 8080);
Expand Down

0 comments on commit 94f813f

Please sign in to comment.