From cb74c3346428d5e352b66d1f7982f77e0e8b8621 Mon Sep 17 00:00:00 2001 From: mia Date: Tue, 23 Apr 2024 19:50:24 -0700 Subject: add expires data to token handoff --- src/server/store.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/store.rs') diff --git a/src/server/store.rs b/src/server/store.rs index 98c1bcc..0911090 100644 --- a/src/server/store.rs +++ b/src/server/store.rs @@ -166,7 +166,7 @@ impl Store { } } - pub async fn check_token(&self, token: &str) -> Option { + pub async fn check_token(&self, token: &str) -> Option<(String, SystemTime)> { let guard = self.0.read().await; let Some((name, expires)) = guard.token_map.get(token) else { return None; @@ -174,7 +174,7 @@ impl Store { if *expires < SystemTime::now() { return None; } - Some(name.clone()) + Some((name.clone(), expires.clone())) } pub async fn create_invite(&self) -> std::io::Result { -- cgit 1.4.1