From 7c4546faced6d1add4b6c904529601576baa50f4 Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 18 Aug 2024 00:20:22 +0300 Subject: indieauth: Extension -> State whoops --- src/indieauth/mod.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/indieauth/mod.rs b/src/indieauth/mod.rs index 808b9b7..06ec1f7 100644 --- a/src/indieauth/mod.rs +++ b/src/indieauth/mod.rs @@ -252,10 +252,11 @@ async fn verify_credential( } } -#[tracing::instrument(skip(backend, confirmation))] +#[tracing::instrument(skip(backend))] +#[cfg_attr(not(debug_assertions), tracing::instrument(skip(confirmation)))] async fn authorization_endpoint_confirm( Host(host): Host, - Extension(backend): Extension, + State(backend): State, cookies: CookieJar, Json(confirmation): Json, ) -> Response { @@ -323,10 +324,11 @@ async fn authorization_endpoint_confirm( #[tracing::instrument(skip(backend, db))] async fn authorization_endpoint_post( Host(host): Host, - Extension(backend): Extension, - Extension(db): Extension, + State(backend): State, + State(db): State, Form(grant): Form, ) -> Response { + tracing::debug!("Processing grant..."); match grant { GrantRequest::AuthorizationCode { code, @@ -414,8 +416,8 @@ async fn authorization_endpoint_post( #[tracing::instrument(skip(backend, db))] async fn token_endpoint_post( Host(host): Host, - Extension(backend): Extension, - Extension(db): Extension, + State(backend): State, + State(db): State, Form(grant): Form, ) -> Response { #[inline] @@ -667,7 +669,7 @@ async fn token_endpoint_post( async fn introspection_endpoint_post( Host(host): Host, TypedHeader(Authorization(auth_token)): TypedHeader>, - Extension(backend): Extension, + State(backend): State, Form(token_request): Form, ) -> Response { use serde_json::json; @@ -702,7 +704,7 @@ async fn introspection_endpoint_post( async fn revocation_endpoint_post( Host(host): Host, - Extension(backend): Extension, + State(backend): State, Form(revocation): Form, ) -> impl IntoResponse { let me: url::Url = format!("https://{}/", host).parse().unwrap(); @@ -758,8 +760,8 @@ async fn get_profile( async fn userinfo_endpoint_get( Host(host): Host, TypedHeader(Authorization(auth_token)): TypedHeader>, - Extension(backend): Extension, - Extension(db): Extension + State(backend): State, + State(db): State ) -> Response { use serde_json::json; -- cgit 1.4.1