diff --git a/public/api/auth/index.ts b/public/api/auth/index.ts index 759ea86..d3284ed 100644 --- a/public/api/auth/index.ts +++ b/public/api/auth/index.ts @@ -10,7 +10,7 @@ import { get_session, get_user, PRECHECK_TABLE, require_user, SESSION_ID_TOKEN, import * as bcrypt from '@da/bcrypt'; import { verifyTotp } from '../../../utils/totp.ts'; -const DEFAULT_SESSION_TIME: number = 28 * (24 * (60 * (60 * 1_000))); // 28 days +const DEFAULT_SESSION_TIME: number = 365 * (24 * (60 * (60 * 1_000))); // 365 days export const PRECHECKS: PRECHECK_TABLE = {}; @@ -186,7 +186,7 @@ const session_secret_buffer = new Uint8Array(20); export async function create_new_session(session_settings: SESSION_INFO): Promise { const now = new Date().toISOString(); const expires: string = session_settings.expires ?? - new Date(new Date(now).valueOf() + DEFAULT_SESSION_TIME).toISOString(); + new Date(new Date(now).valueOf() + DEFAULT_SESSION_TIME).toUTCString(); crypto.getRandomValues(session_secret_buffer);