about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--indieauth/src/lib.rs18
-rw-r--r--src/indieauth/mod.rs2
2 files changed, 12 insertions, 8 deletions
diff --git a/indieauth/src/lib.rs b/indieauth/src/lib.rs
index ce0ef9f..cbe9085 100644
--- a/indieauth/src/lib.rs
+++ b/indieauth/src/lib.rs
@@ -585,13 +585,17 @@ pub enum GrantResponse {
     ///
     /// This is suitable for confirming the identity of the user, but
     /// no more than that.
-    ProfileUrl {
-        /// The authenticated user's URL.
-        me: Url,
-        /// The user's profile information, if it was requested.
-        #[serde(skip_serializing_if = "Option::is_none")]
-        profile: Option<Profile>
-    }
+    ProfileUrl(ProfileUrl)
+}
+
+/// The contents of a profile URL response.
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
+pub struct ProfileUrl {
+    /// The authenticated user's URL.
+    pub me: Url,
+    /// The user's profile information, if it was requested.
+    #[serde(skip_serializing_if = "Option::is_none")]
+    pub profile: Option<Profile>
 }
 
 #[cfg(feature = "axum")]
diff --git a/src/indieauth/mod.rs b/src/indieauth/mod.rs
index de4c367..c09b426 100644
--- a/src/indieauth/mod.rs
+++ b/src/indieauth/mod.rs
@@ -400,7 +400,7 @@ async fn authorization_endpoint_post<A: AuthBackend, D: Storage + 'static>(
                 None
             };
 
-            GrantResponse::ProfileUrl { me, profile }.into_response()
+            GrantResponse::ProfileUrl(ProfileUrl { me, profile }).into_response()
         },
         _ => Error {
             kind: ErrorKind::InvalidGrant,