diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-11-05 17:17:59 -0500 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-11-05 17:17:59 -0500 |
| commit | e08c3fa46aa48ac5cbeb75f52fc27d4061e2fa62 (patch) | |
| tree | be0c7d1d49b8a3e3e8d92a12d22c4a4f74325bf7 | |
| parent | 3c588861ef5814de329743147398dbae22c1aeeb (diff) | |
Small refactoring to the Vapid key rotation middleware for consistency.
This is the same "use a component directly rather than obtaining one from the `App`" change that was previously applied to most endpoints and middleware. I just forgot to do it here when making that change.
| -rw-r--r-- | src/vapid/middleware.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vapid/middleware.rs b/src/vapid/middleware.rs index 02951ba..3129aa7 100644 --- a/src/vapid/middleware.rs +++ b/src/vapid/middleware.rs @@ -4,14 +4,14 @@ use axum::{ response::Response, }; -use crate::{app::App, clock::RequestedAt, error::Internal}; +use crate::{clock::RequestedAt, error::Internal, vapid::app::Vapid}; pub async fn middleware( - State(app): State<App>, + State(vapid): State<Vapid>, RequestedAt(now): RequestedAt, request: Request, next: Next, ) -> Result<Response, Internal> { - app.vapid().refresh_key(&now).await?; + vapid.refresh_key(&now).await?; Ok(next.run(request).await) } |
