From 9e2fe61267846ce216e0c498d8fa9ee672e03cbf Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 24 Oct 2024 00:46:45 +0200 Subject: [PATCH] feat: add user_auth_logout method --- src/client/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/mod.rs b/src/client/mod.rs index 47788d1..659ad69 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -1255,6 +1255,15 @@ impl RustyPipe { Ok(()) } + /// Log out the user and remove the OAuth token from the cache + pub async fn user_auth_logout(&self) { + { + let mut cache_token = self.inner.cache.oauth_token.write().unwrap(); + *cache_token = None; + } + self.store_cache().await; + } + async fn refresh_token(&self, refresh_token: &str) -> Result { tracing::debug!("refreshing OAuth token");