Files
next-fiber/lib/auth-cookies.ts
Beyhan Oğur b2825e1698 first commit
2026-04-26 22:14:08 +03:00

26 lines
579 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Cookie adları ve ayarları JWT için HTTP-only secure cookie.
* Sadece sunucu tarafında (API route) kullanılır.
*/
const COOKIE_ACCESS = "auth_access_token";
const COOKIE_REFRESH = "auth_refresh_token";
const isProd = process.env.NODE_ENV === "production";
const COOKIE_OPTS = {
httpOnly: true,
secure: isProd,
sameSite: "lax" as const,
path: "/",
};
const ACCESS_MAX_AGE = 24 * 60 * 60; // 1 gün
const REFRESH_MAX_AGE = 30 * 24 * 60 * 60; // 30 gün
export {
COOKIE_ACCESS,
COOKIE_REFRESH,
COOKIE_OPTS,
ACCESS_MAX_AGE,
REFRESH_MAX_AGE,
};