about summary refs log tree commit diff
path: root/indieauth
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-18 00:28:00 +0300
committerVika <vika@fireburn.ru>2024-08-18 00:28:00 +0300
commitcd8029a930b966225d0a57afb1ee29808fe2a409 (patch)
tree50c9c4148e026a9886f9503b4db6f5d0db3f0e38 /indieauth
parenta003db6d0a6bbebdb10dd904530d474c1cfea5ad (diff)
downloadkittybox-cd8029a930b966225d0a57afb1ee29808fe2a409.tar.zst
kittybox-indieauth: support transforming strings to PKCEVerifier
for apps that can't hold state for long
Diffstat (limited to 'indieauth')
-rw-r--r--indieauth/src/pkce.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/indieauth/src/pkce.rs b/indieauth/src/pkce.rs
index 852ce0a..8dcf9b1 100644
--- a/indieauth/src/pkce.rs
+++ b/indieauth/src/pkce.rs
@@ -28,6 +28,11 @@ impl PKCEMethod {
 #[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
 pub struct PKCEVerifier(pub(super) String);
 
+impl<T: Into<String>> From<T> for PKCEVerifier {
+    fn from(t: T) -> Self {
+        Self(t.into())
+    }
+}
 impl AsRef<str> for PKCEVerifier {
     fn as_ref(&self) -> &str {
         self.0.as_str()