diff options
Diffstat (limited to 'crates/turtle/src/atuin_client/meta.rs')
| -rw-r--r-- | crates/turtle/src/atuin_client/meta.rs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/crates/turtle/src/atuin_client/meta.rs b/crates/turtle/src/atuin_client/meta.rs index 92902c08..f3815b9e 100644 --- a/crates/turtle/src/atuin_client/meta.rs +++ b/crates/turtle/src/atuin_client/meta.rs @@ -142,22 +142,6 @@ impl MetaStore { ) .await } - - pub(crate) async fn session_token(&self) -> Result<Option<String>> { - self.get(KEY_SESSION).await - } - - pub(crate) async fn save_session(&self, token: &str) -> Result<()> { - self.set(KEY_SESSION, token).await - } - - pub(crate) async fn delete_session(&self) -> Result<()> { - self.delete(KEY_SESSION).await - } - - pub(crate) async fn logged_in(&self) -> Result<bool> { - Ok(self.session_token().await?.is_some()) - } } #[cfg(test)] @@ -205,22 +189,4 @@ mod tests { let t = store.last_sync().await.unwrap(); assert!(t > OffsetDateTime::UNIX_EPOCH); } - - #[tokio::test] - async fn test_session_crud() { - let store = new_test_store().await; - - assert!(!store.logged_in().await.unwrap()); - assert_eq!(store.session_token().await.unwrap(), None); - - store.save_session("tok123").await.unwrap(); - assert!(store.logged_in().await.unwrap()); - assert_eq!( - store.session_token().await.unwrap(), - Some("tok123".to_string()) - ); - - store.delete_session().await.unwrap(); - assert!(!store.logged_in().await.unwrap()); - } } |
