diff options
author | mia <mia@mia.jetzt> | 2024-04-23 19:50:24 -0700 |
---|---|---|
committer | mia <mia@mia.jetzt> | 2024-04-23 19:50:24 -0700 |
commit | cb74c3346428d5e352b66d1f7982f77e0e8b8621 (patch) | |
tree | 143a2168f076c2ede754fbb8527c6b1a8baa4de1 /src/server/store.rs | |
parent | 979d3d2fd87d5def87d27f4991ca8624c72b2317 (diff) | |
download | dissociate-0.2.3.tar.gz dissociate-0.2.3.zip |
add expires data to token handoff v0.2.3
Diffstat (limited to 'src/server/store.rs')
-rw-r--r-- | src/server/store.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<String> { + 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<String> { |