Skip to content

Commit 40b92e4

Browse files
committed
refactor: group vuefire module options in runtimeconfig
1 parent 70cb1c8 commit 40b92e4

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

packages/nuxt/src/module.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,6 @@ export default defineNuxtModule<VueFireNuxtModuleOptions>({
195195
addPlugin(resolve(runtimeDir, 'auth/plugin-user-token.server'))
196196
}
197197

198-
if (options.admin?.options) {
199-
// used by the admin app plugin to initialize the admin app
200-
nuxt.options.runtimeConfig.vuefireAdminOptions = options.admin.options
201-
}
202198
// injects firebaseAdminApp
203199
addPlugin(resolve(runtimeDir, 'admin/plugin.server'))
204200
}
@@ -282,13 +278,6 @@ export type {
282278
* Augments the Nuxt Runtime Config with the VueFire module options.
283279
*/
284280
interface VueFireRuntimeConfig {
285-
/**
286-
* Firebase Admin options passed to VueFire module. Only available on the server.
287-
*
288-
* @internal
289-
*/
290-
vuefireAdminOptions?: Omit<AppOptions, 'credential'>
291-
292281
/**
293282
* Runtime config for the VueFire module.
294283
*/

packages/nuxt/src/runtime/admin/plugin.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { defineNuxtPlugin, useRequestEvent, useRuntimeConfig } from '#app'
44

55
export default defineNuxtPlugin(() => {
66
const event = useRequestEvent()
7-
const { vuefireAdminOptions } = useRuntimeConfig()
7+
const { vuefire } = useRuntimeConfig()
88

9-
const firebaseAdminApp = getAdminApp(vuefireAdminOptions)
9+
const firebaseAdminApp = getAdminApp(vuefire?.options?.admin?.options)
1010

1111
// TODO: Is this accessible within middlewares and api routes? or should we use a middleware to add it
1212
event.context.firebaseApp = firebaseAdminApp

0 commit comments

Comments
 (0)