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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user