chore: refactor sessions

This commit is contained in:
David Nguyen
2025-02-16 00:44:01 +11:00
parent 8d5fafec27
commit 1ed1cb0773
21 changed files with 261 additions and 307 deletions

View File

@ -48,11 +48,9 @@ export const PASSKEY_TIMEOUT = 60000;
*/
export const MAXIMUM_PASSKEYS = 50;
// Todo: nextuauth_url ??
export const useSecureCookies =
env('NODE_ENV') === 'production' && String(NEXT_PUBLIC_WEBAPP_URL()).startsWith('https://');
// Todo: Test secure cookies prefix in remix.
const secureCookiePrefix = useSecureCookies ? '__Secure-' : '';
export const formatSecureCookieName = (name: string) => `${secureCookiePrefix}${name}`;