mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Remove database check from auth setup flow
This commit is contained in:
@@ -8,7 +8,6 @@ import type { ProjectConfig } from "../types";
|
|||||||
export async function setupAuth(
|
export async function setupAuth(
|
||||||
projectDir: string,
|
projectDir: string,
|
||||||
enableAuth: boolean,
|
enableAuth: boolean,
|
||||||
hasDatabase: boolean,
|
|
||||||
options: ProjectConfig,
|
options: ProjectConfig,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const serverDir = path.join(projectDir, "packages/server");
|
const serverDir = path.join(projectDir, "packages/server");
|
||||||
@@ -19,15 +18,6 @@ export async function setupAuth(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasDatabase) {
|
|
||||||
log.warn(
|
|
||||||
pc.yellow(
|
|
||||||
"Authentication enabled but no database selected. Auth will not function properly.",
|
|
||||||
),
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const envPath = path.join(serverDir, ".env");
|
const envPath = path.join(serverDir, ".env");
|
||||||
const templateEnvPath = path.join(
|
const templateEnvPath = path.join(
|
||||||
PKG_ROOT,
|
PKG_ROOT,
|
||||||
|
|||||||
@@ -70,12 +70,7 @@ export async function createProject(options: ProjectConfig): Promise<string> {
|
|||||||
options.turso ?? options.database === "sqlite",
|
options.turso ?? options.database === "sqlite",
|
||||||
);
|
);
|
||||||
|
|
||||||
await setupAuth(
|
await setupAuth(projectDir, options.auth, options);
|
||||||
projectDir,
|
|
||||||
options.auth,
|
|
||||||
options.database !== "none",
|
|
||||||
options,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options.git) {
|
if (options.git) {
|
||||||
await $({ cwd: projectDir })`git init`;
|
await $({ cwd: projectDir })`git init`;
|
||||||
|
|||||||
Reference in New Issue
Block a user