Skip to content

Commit dc76d6e

Browse files
authored
fix(cahe purge): both CACHE_PURGE_ZONE_ID and CACHE_PURGE_API_TOKEN are required (#872)
1 parent 9b28913 commit dc76d6e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/bright-planes-yawn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@opennextjs/cloudflare": patch
3+
---
4+
5+
Fix check for missing CACHE_PURGE_ZONE_ID

packages/cloudflare/src/api/overrides/internal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function purgeCacheByTags(tags: string[]) {
4949
}
5050

5151
export async function internalPurgeCacheByTags(env: CloudflareEnv, tags: string[]) {
52-
if (!env.CACHE_PURGE_ZONE_ID && !env.CACHE_PURGE_API_TOKEN) {
52+
if (!env.CACHE_PURGE_ZONE_ID || !env.CACHE_PURGE_API_TOKEN) {
5353
// THIS IS A NO-OP
5454
error("No cache zone ID or API token provided. Skipping cache purge.");
5555
return "missing-credentials";

0 commit comments

Comments
 (0)