summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2026-04-19 01:57:16 -0400
committerDax Raad <[email protected]>2026-04-19 01:57:16 -0400
commit40834fdf2feda0ed3eded2a5e4076b7c77204989 (patch)
treeb35fe83a29e11d8d438048456281b0e76a1efcc0 /packages
parentfc0588954b01ab421bb4833173fa48c422cea4d5 (diff)
downloadopencode-40834fdf2feda0ed3eded2a5e4076b7c77204989.tar.gz
opencode-40834fdf2feda0ed3eded2a5e4076b7c77204989.zip
core: allow users with credits but no payment method to access zen mode
Diffstat (limited to 'packages')
-rw-r--r--packages/console/app/src/routes/zen/util/handler.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/console/app/src/routes/zen/util/handler.ts b/packages/console/app/src/routes/zen/util/handler.ts
index 2e576eaf6..9093739b1 100644
--- a/packages/console/app/src/routes/zen/util/handler.ts
+++ b/packages/console/app/src/routes/zen/util/handler.ts
@@ -762,7 +762,7 @@ export async function handler(
const billing = authInfo.billing
const billingUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/billing`
const membersUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/members`
- if (!billing.paymentMethodID) throw new CreditsError(t("zen.api.error.noPaymentMethod", { billingUrl }))
+ if (!billing.paymentMethodID && billing.balance <= 0) throw new CreditsError(t("zen.api.error.noPaymentMethod", { billingUrl }))
if (billing.balance <= 0) throw new CreditsError(t("zen.api.error.insufficientBalance", { billingUrl }))
const now = new Date()