Skip to content

Commit 360295f

Browse files
committed
localhost or 127.0.0.1 for auth domain
1 parent d3f129b commit 360295f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builder-frontend/src/firebase/firebase.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export const auth = getAuth(app);
2929
if (import.meta.env.MODE === 'development') {
3030
try {
3131
// Use http for localhost, https for remote environments (Codespaces, Gitpod, etc.)
32-
const protocol = AUTH_DOMAIN.startsWith('localhost') ? 'http' : 'https';
32+
prefixes = ["localhost", "127.0.0.1"];
33+
const isLocalhost = prefixes.some(prefix => AUTH_DOMAIN.startsWith(prefix));
34+
const protocol = isLocalhost ? 'http' : 'https';
3335
const authEmulatorUrl = `${protocol}://${AUTH_DOMAIN}`;
3436
connectAuthEmulator(auth, authEmulatorUrl, { disableWarnings: true });
3537
console.log("🔧 Connected to Firebase emulators");

0 commit comments

Comments
 (0)