Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
noook opened this issue Mar 21, 2023 · 2 comments

Comments

@noook
Copy link

noook commented Mar 21, 2023

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

@35C4n0r
Copy link

35C4n0r commented May 2, 2023

I am also facing the same issue, on passing serviceAccount as

serviceAccount: {
    projectId: "...",
    privateKey: "..."
    clientEmail: "...",
}

I still get the warning that SSR is enabled but admin config has not been passed.
Any idea when the related PR can be merged ?

@posva
Copy link
Member

posva commented Jul 7, 2023

This should be fixed now but it's necessary to pass an environment variable See the changelog

@posva posva closed this as completed Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants