Skip to content

Commit 684ebbf

Browse files
committed
fix(plugin-auth): inline the agent forward seam at its use() call so the wildcard fall-through guard can verify it yields
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyagSyLB5ckJsKghoa
1 parent 6bbf2ee commit 684ebbf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/plugins/plugin-auth/src/auth-plugin.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3096,7 +3096,11 @@ export class AuthPlugin implements Plugin {
30963096
// D5 allow-list, so a forward is judged by the same network gate. A
30973097
// credential that does not redeem resolves as nobody. See
30983098
// `agent-forward-identity-view.ts`.
3099-
if (typeof rawApp.use === 'function') rawApp.use(`${basePath}/*`, serveAgentForwardAtIdentityMount);
3099+
// Inlined so the wildcard fall-through guard (#4116) can read that it
3100+
// yields: every branch of the seam hands the request on to `next`.
3101+
if (typeof rawApp.use === 'function') {
3102+
rawApp.use(`${basePath}/*`, (c: any, next: () => Promise<void>) => serveAgentForwardAtIdentityMount(c, next));
3103+
}
31003104

31013105
// Register /config before the wildcard so it takes precedence.
31023106
// better-auth has no /config endpoint, so without this explicit route

0 commit comments

Comments
 (0)