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 a3c7752
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- main
env:
BRANCH_NAME: ${{ github.ref_name }}
CI: CI # Always set to 'true' in GitHub Actions
jobs:
lint:
runs-on: ubuntu-latest
Expand Down
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 === "true";

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 && 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 a3c7752

Please sign in to comment.