-
-
Notifications
You must be signed in to change notification settings - Fork 346
Closed
Description
Reproduction
(I can't make a reproduction yet, Nuxt crashes when loading nuxt-vuefire
as a module, I'll open a separate issue)
Steps to reproduce the bug
- Configure vuefire, with admin service account as an object
- Run the server
- The following code is not executed, resulting in
/api/__session
and'auth/plugin-mint-cookie.client
not being registeredvuefire/packages/nuxt/src/module.ts
Lines 127 to 135 in 90be27a
if (nuxt.options.ssr && hasServiceAccount) { addServerHandler({ route: '/api/__session', handler: resolve(runtimeDir, './auth/api.session'), }) // must be added after (which means before in code) the plugin module addPlugin(resolve(runtimeDir, 'auth/plugin-mint-cookie.client')) }
Expected behavior
When configuring the service account with an object instead of a file path, I should have the same behaviour.
The logic to handle the object as service account credentials is already handled here:
vuefire/packages/nuxt/src/runtime/admin/plugin.server.ts
Lines 53 to 58 in 86c276e
} else if ( | |
typeof firebaseAdmin?.serviceAccount === 'object' && | |
firebaseAdmin.serviceAccount != null | |
) { | |
credential = cert(firebaseAdmin.serviceAccount) | |
} else { |
Actual behavior
The handler and plugin are not registered even though the admin service account is configured
Additional information
A PR is already ready for that: #1319
enrique-fernandez-polo and johnpuaoi
Metadata
Metadata
Assignees
Labels
No labels