fix: fix.env.example

This commit is contained in:
rafiarrafif
2025-06-14 15:05:20 +07:00
parent b52f1202eb
commit ac10ae14f6
75 changed files with 2532 additions and 2532 deletions

View File

@ -1,33 +1,33 @@
import { serialize } from "cookie";
export const clearCookies = (
set: any,
cookieKeys: string[],
options?: Partial<{
httpOnly: boolean;
secure: boolean;
sameSite: "strict" | "lax" | "none";
path: string;
}>
) => {
// Define the default configurations for clearing cookies
const defaultOptions = {
httpOnly: true,
secure: true,
sameSite: "strict" as const,
path: "/",
...options,
};
// Create an array of cleared cookies with the specified names
const clearedCookies = cookieKeys.map((name) => {
return serialize(name, "", {
...defaultOptions,
expires: new Date(0),
});
});
// Set the cleared cookies in the response headers
set.headers["set-cookie"] = clearedCookies;
return clearedCookies;
};
import { serialize } from "cookie";
export const clearCookies = (
set: any,
cookieKeys: string[],
options?: Partial<{
httpOnly: boolean;
secure: boolean;
sameSite: "strict" | "lax" | "none";
path: string;
}>
) => {
// Define the default configurations for clearing cookies
const defaultOptions = {
httpOnly: true,
secure: true,
sameSite: "strict" as const,
path: "/",
...options,
};
// Create an array of cleared cookies with the specified names
const clearedCookies = cookieKeys.map((name) => {
return serialize(name, "", {
...defaultOptions,
expires: new Date(0),
});
});
// Set the cleared cookies in the response headers
set.headers["set-cookie"] = clearedCookies;
return clearedCookies;
};