Private
Public Access
1
0

daemon: implement solution for background sync

This commit is contained in:
2025-04-27 13:40:59 -07:00
parent 22554a7644
commit 84f782cc03
8 changed files with 154 additions and 79 deletions

View File

@@ -27,8 +27,8 @@ pub trait APIInterface {
}
pub trait TokenManagement {
fn get_token(&mut self) -> Option<JwtToken>;
fn set_token(&mut self, token: JwtToken);
async fn get_token(&mut self) -> Option<JwtToken>;
async fn set_token(&mut self, token: JwtToken);
}
pub struct InMemoryTokenManagement {
@@ -42,11 +42,11 @@ impl InMemoryTokenManagement {
}
impl TokenManagement for InMemoryTokenManagement {
fn get_token(&mut self) -> Option<JwtToken> {
async fn get_token(&mut self) -> Option<JwtToken> {
self.token.clone()
}
fn set_token(&mut self, token: JwtToken) {
async fn set_token(&mut self, token: JwtToken) {
self.token = Some(token);
}
}