Seed admin acccount and generalize login/auth routes

This commit is contained in:
Dominic Ferrando
2026-08-21 10:10:22 -04:00
parent 5432610090
commit 4dbcccdef7
8 changed files with 54 additions and 51 deletions
+5 -1
View File
@@ -2,6 +2,7 @@
import "../app.css";
import { goto } from "$app/navigation";
import { api } from "$lib/api";
import { env } from "$env/dynamic/public";
let error = $state("");
let loading = $state(false);
@@ -14,7 +15,10 @@
loading = true;
try {
const { status } = await api.auth.admin.login.post({ password });
const { status } = await api.auth.login.post({
email: env.PUBLIC_ADMIN_EMAIL ?? "",
password,
});
if (status === 401) {
error = "Invalid password";