Skip to content

Commit 82ce282

Browse files
committed
fix: use VueFire plugin without auth
1 parent b4ffc4e commit 82ce282

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

packages/nuxt/src/module.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -153,28 +153,23 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
153153
}
154154
}
155155

156+
// this adds the VueFire plugin and handle SSR state serialization and hydration
157+
addPluginTemplate({
158+
src: normalize(resolve(templatesDir, 'plugin.ejs')),
159+
options: {
160+
...options,
161+
ssr: nuxt.options.ssr,
162+
},
163+
})
164+
156165
if (options.auth) {
157166
if (nuxt.options.ssr && !hasServiceAccount && !emulatorsConfig) {
158167
logger.warn(
159168
'You activated both SSR and auth but you are not providing a service account for the admin SDK. See https://vuefire.vuejs.org/nuxt/getting-started.html#configuring-the-admin-sdk.'
160169
)
161170
}
162171

163-
// this adds the VueFire plugin and handle SSR state serialization and hydration
164-
addPluginTemplate({
165-
src: normalize(resolve(templatesDir, 'plugin.ejs')),
166-
167-
options: {
168-
...options,
169-
ssr: nuxt.options.ssr,
170-
},
171-
})
172-
173-
if (
174-
options.auth &&
175-
nuxt.options.ssr &&
176-
(hasServiceAccount || emulatorsConfig)
177-
) {
172+
if (nuxt.options.ssr && (hasServiceAccount || emulatorsConfig)) {
178173
// Add the session handler than mints a cookie for the user
179174
addServerHandler({
180175
route: '/api/__session',

0 commit comments

Comments
 (0)