Add optional 30-day remembered sessions
CI / checks (push) Successful in 6m29s

This commit is contained in:
2026-10-13 14:42:53 -04:00
parent e85dc58130
commit 82e07ea33e
13 changed files with 677 additions and 72 deletions
+9
View File
@@ -24,6 +24,15 @@ export function migrateAuthSchema(handle: Database.Database): void {
`);
}
export function migrateRememberedSessions(handle: Database.Database): void {
const columns = handle.pragma('table_info(auth_sessions)') as { name: string }[];
if (columns.some((column) => column.name === 'remembered')) return;
handle.exec(`
ALTER TABLE auth_sessions ADD COLUMN remembered INTEGER NOT NULL DEFAULT 0
CHECK(remembered IN (0,1));
`);
}
/** Run with foreign keys disabled by the migration runner before its transaction. */
export function migrateSuperViewerRole(handle: Database.Database): void {
const schema = handle