Skip to content

Commit

Permalink
fix integration with async middleware updates
Browse files Browse the repository at this point in the history
  • Loading branch information
BRKalow committed Oct 22, 2024
1 parent 1997eac commit 78d6c4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changeset/clean-fishes-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
6 changes: 3 additions & 3 deletions integration/tests/handshake.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,9 @@ const startAppWithOrganizationSyncOptions = async (clerkAPIUrl: string): Promise
export const middleware = (req, evt) => {
const orgSyncOptions = req.headers.get("x-organization-sync-options")
return clerkMiddleware((auth, req) => {
if (isProtectedRoute(req) && !auth().userId) {
auth().redirectToSignIn()
return clerkMiddleware(async (auth, req) => {
if (isProtectedRoute(req) && !(await auth()).userId) {
(await auth()).redirectToSignIn()
}
}, {
publishableKey: req.headers.get("x-publishable-key"),
Expand Down

0 comments on commit 78d6c4b

Please sign in to comment.