Skip to content

Commit 40834fd

Browse files
committed
core: allow users with credits but no payment method to access zen mode
1 parent fc05889 commit 40834fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/console/app/src/routes/zen/util

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ export async function handler(
762762
const billing = authInfo.billing
763763
const billingUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/billing`
764764
const membersUrl = `https://opencode.ai/workspace/${authInfo.workspaceID}/members`
765-
if (!billing.paymentMethodID) throw new CreditsError(t("zen.api.error.noPaymentMethod", { billingUrl }))
765+
if (!billing.paymentMethodID && billing.balance <= 0) throw new CreditsError(t("zen.api.error.noPaymentMethod", { billingUrl }))
766766
if (billing.balance <= 0) throw new CreditsError(t("zen.api.error.insufficientBalance", { billingUrl }))
767767

768768
const now = new Date()

0 commit comments

Comments
 (0)