26 lines
579 B
TypeScript
26 lines
579 B
TypeScript
/**
|
||
* 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,
|
||
};
|