fix(auth): clean up expired sessions on server startup

Wire the existing delete_expired() method to run at startup so the
sessions table doesn't grow unboundedly with stale rows.
This commit is contained in:
Jon Seager 2026-02-06 18:19:30 +00:00
parent b5fdf8b27c
commit 42b971658d
No known key found for this signature in database

View file

@ -51,6 +51,11 @@ pub async fn serve(config: ServerConfig) -> anyhow::Result<()> {
}, },
); );
// Clean up expired sessions on startup
if let Err(err) = state.session_repo.delete_expired().await {
tracing::warn!(error = %err, "failed to clean up expired sessions on startup");
}
// Bootstrap: if no users exist, generate a one-time registration token // Bootstrap: if no users exist, generate a one-time registration token
bootstrap_registration( bootstrap_registration(
&state.registration_token_repo, &state.registration_token_repo,