another step constructing base project

This commit is contained in:
hamid
2026-06-18 01:19:23 +03:30
parent 5388bea320
commit e135b0b919
27 changed files with 1022 additions and 355 deletions
+16
View File
@@ -1,5 +1,7 @@
export const COOKIE_NAMES = {
COLOR_SCHEME: 'color-scheme',
ACCESS_TOKEN: 'access_token',
REFRESH_TOKEN: 'refresh_token',
} as const;
export type CookieName = (typeof COOKIE_NAMES)[keyof typeof COOKIE_NAMES];
@@ -16,3 +18,17 @@ export const COLOR_SCHEME_COOKIE_OPTIONS: CookieOptions = {
maxAge: 60 * 60 * 24 * 365,
sameSite: 'lax',
};
export const AUTH_ACCESS_COOKIE_OPTIONS: CookieOptions = {
path: '/',
maxAge: 900, // 15 minutes
sameSite: 'lax',
secure: true,
};
export const AUTH_REFRESH_COOKIE_OPTIONS: CookieOptions = {
path: '/',
maxAge: 60 * 60 * 24 * 7, // 7 days
sameSite: 'lax',
secure: true,
};