I ran into an issue when Astro SSR node build tried to eagerly initialize Auth.js config and required a working connection to the adapter DB (Mongo in my case). Unfortunately Auth.js config doesn't allow passing a factory function instead of an adapter instance.
I wonder if auth-astro could instead use a factory of Auth.js config in its build phase to avoid eagerly evaluating adapters.
As a workaround, I manager to use Proxy to wrap and lazy initialize the MongoDBAdapter. But that feels like a horrible hack.
I ran into an issue when Astro SSR node build tried to eagerly initialize Auth.js config and required a working connection to the adapter DB (Mongo in my case). Unfortunately Auth.js config doesn't allow passing a factory function instead of an adapter instance.
I wonder if auth-astro could instead use a factory of Auth.js config in its build phase to avoid eagerly evaluating adapters.
As a workaround, I manager to use Proxy to wrap and lazy initialize the MongoDBAdapter. But that feels like a horrible hack.
I think issues like https://github.com/nowaythatworked/auth-astro/issues/52 might be resolved by that change as well.