Skip to content

Commit 6ee1c49

Browse files
committed
feat: avoid enabling auth emulator without auth
1 parent 7f86fa7 commit 6ee1c49

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/nuxt/src/module.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
208208
options.emulators
209209
) {
210210
const emulators = await enableEmulators(
211-
options.emulators,
211+
options,
212212
resolve(nuxt.options.rootDir, 'firebase.json'),
213213
logger
214214
)
@@ -389,7 +389,7 @@ declare module '@vue/runtime-core' {
389389
}
390390

391391
async function enableEmulators(
392-
emulatorOptions: VueFireNuxtModuleOptions['emulators'],
392+
{ emulators: emulatorOptions, auth }: VueFireNuxtModuleOptions,
393393
firebaseJsonPath: string,
394394
logger: typeof consola
395395
) {
@@ -469,6 +469,12 @@ async function enableEmulators(
469469
return acc
470470
}, {} as FirebaseEmulatorsToEnable)
471471

472+
// remove the emulator if auth is not enabled
473+
if (!auth) {
474+
// @ts-expect-error: cannot be deleted without ?: but that creates other errors
475+
delete emulatorsToEnable.auth
476+
}
477+
472478
return emulatorsToEnable
473479
}
474480

0 commit comments

Comments
 (0)