refactor(server): corrected the middleware to be in the correct spot to work as intended
This commit is contained in:
@@ -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`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user