intial setting and auth intergrated

This commit is contained in:
2026-02-24 15:53:58 -06:00
parent 326c2e125c
commit c3379919b9
17 changed files with 304 additions and 52 deletions

View File

@@ -54,7 +54,8 @@ const signin = z.union([
const r = Router();
r.post("/", async (req, res) => {
let login: unknown;
let login: unknown | any;
try {
const validated = signin.parse(req.body);
if ("email" in validated) {
@@ -92,6 +93,15 @@ r.post("/", async (req, res) => {
password: validated.password,
},
headers: fromNodeHeaders(req.headers),
asResponse: true,
});
login.headers.forEach((value: string, key: string) => {
if (key.toLowerCase() === "set-cookie") {
res.append("set-cookie", value);
} else {
res.setHeader(key, value);
}
});
}