Skip to content

Commit ea4784e

Browse files
committed
fix(nextjs): Fix cookies() usage in server action
1 parent a917a2d commit ea4784e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/gentle-numbers-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/nextjs": patch
3+
---
4+
5+
Await usage of cookies() and ensure the return value of the server action is valid.

packages/nextjs/src/app-router/server-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ import { cookies } from 'next/headers';
77
// and the async is no longer required in newer next versions.
88
// ref: https://github.com/vercel/next.js/pull/62821
99
export async function invalidateCacheAction() {
10-
return cookies().delete(`__clerk_invalidate_cache_cookie_${Date.now()}`);
10+
void (await cookies()).delete(`__clerk_invalidate_cache_cookie_${Date.now()}`);
1111
}

0 commit comments

Comments
 (0)