about summary refs log tree commit diff
path: root/indieauth
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-18 00:13:29 +0300
committerVika <vika@fireburn.ru>2024-08-18 00:19:30 +0300
commitf5587c32d42c8b0ce591affd2ef5d7a30c24257f (patch)
tree1ac9eb8b7598ec79198a00be0eb8125761e2eb2b /indieauth
parent298c8c885350d7de581f927f1d196a797627bd9f (diff)
downloadkittybox-f5587c32d42c8b0ce591affd2ef5d7a30c24257f.tar.zst
kittybox-indieauth: separate ProfileUrl struct from GrantResponse
Seems to be useful on its own.
Diffstat (limited to 'indieauth')
-rw-r--r--indieauth/src/lib.rs18
1 files changed, 11 insertions, 7 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")]