diff options
author | Vika <vika@fireburn.ru> | 2024-08-18 00:13:29 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-08-18 00:19:30 +0300 |
commit | f5587c32d42c8b0ce591affd2ef5d7a30c24257f (patch) | |
tree | 1ac9eb8b7598ec79198a00be0eb8125761e2eb2b /indieauth/src | |
parent | 298c8c885350d7de581f927f1d196a797627bd9f (diff) | |
download | kittybox-f5587c32d42c8b0ce591affd2ef5d7a30c24257f.tar.zst |
kittybox-indieauth: separate ProfileUrl struct from GrantResponse
Seems to be useful on its own.
Diffstat (limited to 'indieauth/src')
-rw-r--r-- | indieauth/src/lib.rs | 18 |
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")] |