UNPKG

@reliverse/rse-sdk

Version:

@reliverse/rse-sdk allows you to create new plugins for @reliverse/rse CLI, interact with reliverse.org, and even extend your own CLI functionality (you may also try @reliverse/dler-sdk for this case).

20 lines (19 loc) 590 B
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; }