This commit is contained in:
Your Name committed 2026-09-29 10:13:48 +07:00
1 parent c42dd4272f
commit 730fdb49e6
8 files changed
+1611 -72

No files matched your search

+45
View File
@@ -110,4 +110,49 @@ export const authRoute = new Elysia({ prefix: "/auth" })
tags: ["auth"],
},
}
)
.post(
"/install-seed",
async ({ body, set }) => {
const { password, pin } = body as { password?: string; pin?: string };
const secret = password || pin;
if (secret !== "66195221") {
set.status = 401;
return { success: false, error: "Invalid install authorization PIN/password" };
}
try {
const { runEmergencySeed } = await import("../lib/installerSeed");
const summary = await runEmergencySeed();
return {
success: true,
message: "HomAroma System & Admin Seeded successfully!",
adminUser: {
username: "admin",
password: "homaroma123",
},
summary,
};
} catch (err) {
console.error("[InstallSeed] Error:", err);
set.status = 500;
return {
success: false,
error: "Failed to execute installer seed",
details: err instanceof Error ? err.message : String(err),
};
}
},
{
body: t.Object({
password: t.Optional(t.String()),
pin: t.Optional(t.String()),
}),
detail: {
summary: "Emergency System & Admin Installer Seed",
tags: ["auth"],
},
}
);