baseURL in case of wildcard subdomains?
I wasn't able to find this in the docs, maybe I didn't look in the right place.
I have multi-tenancy with subdomains, and I want the auth paths to be on each tenant subdomain, for ex:
I have multi-tenancy with subdomains, and I want the auth paths to be on each tenant subdomain, for ex:
acme.myapp.com/auth/loginfoo.myapp.com/auth/login
baseUrl value is what's tripping me up. I'm using Fastify, so I'm thinking of doing the following:- use a preHandler hook, where I get the subdomain, generate the tenant-specific
baseUrl, and create a better-auth instance. - Decorate the request with the better-auth instance
- in the
/api/authroute, doawait req.auth.handler(req);