Closed gapinto closed 4 years ago
Hi @gapinto
Can you try setting the configuration isTenantFromSubdomain
like below when using subdomain based tenant
TenancyModule.forRoot({
// This will allow the library to extract the subdomain as tenant id
isTenantFromSubdomain: true,
options: () => {},
uri: (tenantId: string) => `mongodb://localhost/test-tenant-${tenantId}`,
}),
If yes can you provide me the configurations that you are using for postman to replicate testing on my end.
@gapinto i have published a new version v1.0.9
with a small fix for multi-level subdomains. Please let me know if that fixes your issue.
@gapinto can you confirm if this is working for you so that i can close this issue pls?
Closing this issue as there was no followup. Hope the new version addresses the fix.
For example:
I'm using postman to simulate a subdomain: gap.tenancy.com.br The subdomain returned is
tenancy
, where the correct subdomain should be gap.I have edited my etc/hosts to something like this:
127.0.0.1 gap.tenancy.com.br
https://github.com/needle-innovision/nestjs-tenancy/blob/117280bb2ce508a0f1a4336715c78ffe093522ec/lib/tenancy-core.module.ts#L176