refactor(server): corrected the middleware to be in the correct spot to work as intended

This commit is contained in:
2025-03-03 17:32:46 -06:00
parent 275502143c
commit 1af561acb1
7 changed files with 33 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
import {z, createRoute, OpenAPIHono} from "@hono/zod-openapi";
import {login} from "../controllers/login.js";
import {log} from "../../logger/logger.js";
const app = new OpenAPIHono();
@@ -77,7 +78,7 @@ app.openapi(route, async (c) => {
try {
const {token, user} = await login(username.toLowerCase(), password);
log.info({username: username}, "logged in");
// Set the JWT as an HTTP-only cookie
//c.header("Set-Cookie", `auth_token=${token}; HttpOnly; Secure; Path=/; SameSite=None; Max-Age=3600`);