intial setting and auth intergrated
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user