first commit
This commit is contained in:
25
lib/auth-cookies.ts
Normal file
25
lib/auth-cookies.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 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,
|
||||
};
|
||||
Reference in New Issue
Block a user