first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 22:14:08 +03:00
commit b2825e1698
41 changed files with 14258 additions and 0 deletions

25
lib/auth-cookies.ts Normal file
View 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,
};