We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ba404be commit 4a87ebfCopy full SHA for 4a87ebf
src/index.ts
@@ -101,6 +101,8 @@ export function createAuthPlugin(config: AuthPluginConfig = {}): ObjectStackPlug
101
// Better-Auth exposes a handler for all auth routes
102
// The handler expects a Web Request object
103
context.app.all('/api/auth/*', async (req: any) => {
104
+ // Defensive check: ensure authServer is initialized
105
+ // This could happen if the handler is called before onEnable completes
106
if (!authServer) {
107
throw new Error('Auth server not initialized');
108
}
0 commit comments