From f5587c32d42c8b0ce591affd2ef5d7a30c24257f Mon Sep 17 00:00:00 2001 From: Vika Date: Sun, 18 Aug 2024 00:13:29 +0300 Subject: kittybox-indieauth: separate ProfileUrl struct from GrantResponse Seems to be useful on its own. --- indieauth/src/lib.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'indieauth/src/lib.rs') 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 - } + 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 } #[cfg(feature = "axum")] -- cgit 1.4.1