Open Stf-F opened 2 months ago
Hi @posva , having done a bit of digging and testing the issue comes from here: https://github.com/vuejs/vuefire/blob/2e81d21420637a711574c1820c7170c331dda57c/packages/nuxt/src/runtime/auth/api.session-verification.ts#L30
If that were replaced with something along the lines of:
const tenantManager = getAdminAuth(adminApp).tenantManager();
const adminAuth = tenantManager.authForTenant(xxxx);
Then the error would go away and the __session
endpoint be able to set the session cookie.
But this would likely require an update to the vuefire
object to allow for the entry of a tenantId
.
I am happy to assist with the process but I don't trust myself enough to deliver on the code changes themselves.
Let me know if you need anything else.
Cheers
Nice, thanks for the help! I'm currently busy with other stuff so feel free to give it a try in your own projects and open a PR with what you found. It could always be helpful in the future to add the feature
Reproduction
Reproduction on localhost below
Steps to reproduce the bug
VueFire is currently not tenants aware which leads to 500 errors.
On localhost with the auth emulator:
sessionCookies: true
app.vue
nuxt.config.ts
Expected behavior
Full support of multi tenancy for authentication and session cookies
Actual behavior
The
__session
endpoint currently returns a 500 error with the following message when trying to authenticate with a tenantWhich leads to this error:
Additional information
This bug only occurs when session cookies and tenants are combined. Either of these features work when not put together. Thanks