Skip to content

Commit cdc17f0

Browse files
authored
fix(tanstack-start): Load router after updating context (clerk#4432)
1 parent 73b2897 commit cdc17f0

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎.changeset/mighty-ears-cough.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/tanstack-start": patch
3+
---
4+
5+
Revert to loading router after updating the context

‎packages/tanstack-start/src/server/middlewareHandler.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export function createClerkHandler<TRouter extends AnyRouter>(
3030
router.update({
3131
context: { ...router.options.context, ...clerkInitialState },
3232
});
33+
34+
await router.load();
3335
} catch (error) {
3436
if (error instanceof Response) {
3537
// returning the response

0 commit comments

Comments
 (0)