fix: Correctly clear accessToken when logging out.

Token is correctly rotated on the server, it just isnt correctly removed on the client.
closes #5940
This commit is contained in:
Tom Moor
2023-10-05 22:10:07 -04:00
parent 0ae4c7d6bd
commit 773c35ebc3

View File

@@ -2,7 +2,7 @@ import { subHours, subMinutes } from "date-fns";
import Router from "koa-router";
import uniqBy from "lodash/uniqBy";
import { TeamPreference } from "@shared/types";
import { getCookieDomain, parseDomain } from "@shared/utils/domains";
import { parseDomain } from "@shared/utils/domains";
import env from "@server/env";
import auth from "@server/middlewares/authentication";
import { transaction } from "@server/middlewares/transaction";
@@ -180,8 +180,8 @@ router.post(
);
ctx.cookies.set("accessToken", "", {
sameSite: "lax",
expires: subMinutes(new Date(), 1),
domain: getCookieDomain(ctx.hostname, env.isCloudHosted),
});
ctx.body = {