release: v4.1.0

This commit is contained in:
Amruth Pillai
2024-05-05 14:55:06 +02:00
parent 68252c35fc
commit e87b05a93a
282 changed files with 11461 additions and 10713 deletions

View File

@ -1,4 +1,3 @@
import { InternalServerErrorException } from "@nestjs/common";
import { CookieOptions } from "express";
export const getCookieOptions = (grantType: "access" | "refresh"): CookieOptions => {
@ -13,14 +12,10 @@ export const getCookieOptions = (grantType: "access" | "refresh"): CookieOptions
}
// Options For Refresh Token
if (grantType === "refresh") {
return {
httpOnly: true,
sameSite: "strict",
secure: (process.env.PUBLIC_URL ?? "").includes("https://"),
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 2), // 2 days from now
};
}
throw new InternalServerErrorException("InvalidGrantType: " + grantType);
return {
httpOnly: true,
sameSite: "strict",
secure: (process.env.PUBLIC_URL ?? "").includes("https://"),
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 2), // 2 days from now
};
};