@reliverse/rse
Version:
@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power
20 lines (19 loc) • 590 B
JavaScript
import { re } from "@reliverse/relico";
import { cancel, confirm, isCancel } from "@reliverse/rempts";
import { DEFAULT_CONFIG } from "../constants.js";
export async function getAuthChoice(auth, hasDatabase, backend) {
if (backend === "convex") {
return false;
}
if (!hasDatabase) return false;
if (auth !== void 0) return auth;
const response = await confirm({
message: "Add authentication with Better-Auth?",
initialValue: DEFAULT_CONFIG.auth
});
if (isCancel(response)) {
cancel(re.red("Operation cancelled"));
process.exit(0);
}
return response;
}