Seed admin acccount and generalize login/auth routes
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user