Skip to content

Session controller and cookie minting not registered when configuring service account as an object #1330

Closed
@noook

Description

@noook

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

  1. Configure vuefire, with admin service account as an object
  2. Run the server
  3. The following code is not executed, resulting in /api/__session and 'auth/plugin-mint-cookie.client not being registered
    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:

} 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions