Download Reactive-Resume/apps/server/src/auth/utils/cookie.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 651 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Reactive-Resume/apps/server/src/auth/utils/cookie.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/Reactive-Resume/apps/server/src/auth/utils/cookie.ts
-
curl -L -o cookie.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/Reactive-Resume/apps/server/src/auth/utils/cookie.ts
651 Bytes
| import type { CookieOptions } from "express"; | |
| export const getCookieOptions = (grantType: "access" | "refresh"): CookieOptions => { | |
| // Options For Access Token | |
| if (grantType === "access") { | |
| return { | |
| httpOnly: true, | |
| sameSite: "strict", | |
| secure: (process.env.PUBLIC_URL ?? "").includes("https://"), | |
| expires: new Date(Date.now() + 1000 * 60 * 15), // 15 minutes from now | |
| }; | |
| } | |
| // Options For Refresh Token | |
| 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 | |
| }; | |
| }; | |