From aafdeb9ffaf9a993ca4462b3422667e04469b2e3 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 20 Sep 2024 16:09:35 -0400 Subject: Expire messages after 90 days. This is intended to manage storage growth. A community with broadly steady traffic will now reach a steady state (ish) where the amount of storage in use stays within a steady band. The 90 day threshold is a spitball; this should be made configurable for the community's needs. I've also hoisted expiry out into the `app` classes, to reduce the amount of non-database work repo types are doing. This should make it easier to make expiry configurable later on. Includes incidental cleanup and style changes. --- src/repo/login/extract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/repo/login') diff --git a/src/repo/login/extract.rs b/src/repo/login/extract.rs index a45a1cd..e808f4b 100644 --- a/src/repo/login/extract.rs +++ b/src/repo/login/extract.rs @@ -27,7 +27,7 @@ impl FromRequestParts for Login { let secret = identity_token.secret().ok_or(LoginError::Unauthorized)?; let app = State::::from_request_parts(parts, state).await?; - match app.logins().validate(secret, used_at).await { + match app.logins().validate(secret, &used_at).await { Ok(login) => Ok(login), Err(ValidateError::InvalidToken) => Err(LoginError::Unauthorized), Err(other) => Err(other.into()), -- cgit v1.2.3