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
Copy file name to clipboardExpand all lines: content/docs/guides/authentication.mdx
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -626,7 +626,7 @@ await kernel.bootstrap();
626
626
627
627
### Mock Fallback Endpoints
628
628
629
-
When no auth service handler or broker is available, `HttpDispatcher.handleAuth()` automatically provides mock responses for:
629
+
When no auth service handler is registered and the legacy broker login is unavailable, `HttpDispatcher.handleAuth()` automatically provides mock responses for:
630
630
631
631
| Endpoint | Method | Description |
632
632
|:---|:---:|:---|
@@ -639,17 +639,21 @@ When no auth service handler or broker is available, `HttpDispatcher.handleAuth(
639
639
640
640
This ensures that registration and sign-in flows do not return 404 errors in MSW/browser-only environments.
641
641
642
+
> **Note:** In server mode with AuthPlugin loaded, the auth service handler takes priority and the mock fallback is never reached. The mock fallback only activates when AuthPlugin is not loaded (e.g. browser-only Studio builds where `better-auth` is unavailable).
643
+
642
644
### Studio Kernel Factory
643
645
644
-
The Studio app's `createKernel()` factory includes AuthPlugin by default:
646
+
The Studio app runs in the browser, where the Node-only `better-auth` library cannot be bundled. Instead of loading `AuthPlugin` directly, Studio relies on `HttpDispatcher`'s built-in mock fallback to handle auth endpoints in MSW mode:
645
647
646
648
```typescript
647
649
// apps/studio/src/mocks/createKernel.ts
648
-
// WARNING: This secret is for local development only
0 commit comments