🐛 fix: access cookie via header on logout
Some checks failed
Integration Tests / integration-tests (pull_request) Failing after 51s

This commit is contained in:
2026-02-15 22:58:24 +07:00
parent 42aa7ed8d3
commit c74597c57d
5 changed files with 15 additions and 11 deletions

View File

@ -2,10 +2,12 @@ import { Context } from "elysia";
import { mainErrorHandler } from "../../../helpers/error/handler";
import { logoutService } from "../services/http/logout.service";
import { returnWriteResponse } from "../../../helpers/callback/httpResponse";
import { parse } from "cookie";
export const logoutController = async (ctx: Context) => {
try {
const jwtToken = ctx.cookie.auth_token?.value;
const jwtToken = parse(ctx.request.headers.get("auth_token") || "")
.auth_token as string;
const serviceResponse = await logoutService(jwtToken);
return returnWriteResponse(
ctx.set,