You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
We have a multi-tenant site where the tenant name is in the url like tenant1.site.com, tenant2.site.com etc.
I would like each tenant to have a different session secret in fastify session which seems to boil down to the cookie secret. Today it is possible to implement a custom signer, however it does not receive the request as a parameter so it is not possible to use different secrets for sign/unsign per tenant.
I think if the custom signer could receive request as a parameter this could be solved.
sign: (value, req) => { ... }
However, maybe there is a better already solution to my particular scenario?
Motivation
Support for multi tenancy.
Example
fastify.register(require('@fastify/cookie'),{secret: {sign: (value,req)=>{// get tenant from req and fetch corresponding secret// sign cookie with the tenant's secretreturnsignedValue},unsign: (value,req)=>{// get tenant from req and fetch corresponding secret// unsign cookie with the tenant's secretreturn{valid: true,// the cookie has been unsigned successfullyrenew: false,// the cookie has been unsigned with an old secretvalue: 'unsignedValue'}}}})
The text was updated successfully, but these errors were encountered:
Prerequisites
🚀 Feature Proposal
We have a multi-tenant site where the tenant name is in the url like
tenant1.site.com
,tenant2.site.com
etc.I would like each tenant to have a different session secret in fastify session which seems to boil down to the cookie secret. Today it is possible to implement a custom signer, however it does not receive the request as a parameter so it is not possible to use different secrets for sign/unsign per tenant.
I think if the custom signer could receive request as a parameter this could be solved.
However, maybe there is a better already solution to my particular scenario?
Motivation
Support for multi tenancy.
Example
The text was updated successfully, but these errors were encountered: