Skip to content

Commit 15acb52

Browse files
fix(cli): skip auth and payments when backend is none
1 parent 24a7d28 commit 15acb52

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

apps/cli/src/prompts/auth.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export async function getAuthChoice(
99
frontend?: string[],
1010
) {
1111
if (auth !== undefined) return auth;
12+
if (backend === "none") {
13+
return "none" as Auth;
14+
}
1215
if (backend === "convex") {
1316
const supportedBetterAuthFrontends = frontend?.some((f) =>
1417
[

apps/cli/src/prompts/payments.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export async function getPaymentsChoice(
1212
) {
1313
if (payments !== undefined) return payments;
1414

15+
if (backend === "none") {
16+
return "none" as Payments;
17+
}
18+
1519
const isPolarCompatible =
1620
auth === "better-auth" &&
1721
backend !== "convex" &&

apps/cli/src/utils/config-validation.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ export function validateBackendNoneConstraints(
272272
);
273273
}
274274

275+
if (has("payments") && config.payments !== "none") {
276+
exitWithError(
277+
"Backend 'none' requires '--payments none'. Please remove the --payments flag or set it to 'none'.",
278+
);
279+
}
280+
275281
if (has("dbSetup") && config.dbSetup !== "none") {
276282
exitWithError(
277283
"Backend 'none' requires '--db-setup none'. Please remove the --db-setup flag or set it to 'none'.",

0 commit comments

Comments
 (0)