fix: use raw AUD0 client in outbox dispatcher
This commit is contained in:
@@ -44,7 +44,11 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
|
||||
const repo = repository();
|
||||
const dispatcher = new Aud0OutboxDispatcher(repo, createAud0Client());
|
||||
// CRITICAL: the dispatcher must bypass the durable wrapper. Using the
|
||||
// default client here would enqueue the event again and could create an
|
||||
// infinite outbox loop instead of delivering to AUD0.
|
||||
const rawAud0 = createAud0Client(undefined, { durable: false });
|
||||
const dispatcher = new Aud0OutboxDispatcher(repo, rawAud0);
|
||||
const result = await dispatcher.sweep(limit);
|
||||
const stats = await repo.stats();
|
||||
return NextResponse.json({ result, stats });
|
||||
|
||||
Reference in New Issue
Block a user