Private
Public Access
1
0

daemon: adds conversation list limit, fixes auth saving in db auth store

This commit is contained in:
2025-05-03 18:19:48 -07:00
parent 26d54f91d5
commit 0d61b6f2d7
13 changed files with 69 additions and 37 deletions

View File

@@ -54,10 +54,10 @@ impl AuthenticationStore for DatabaseAuthenticationStore {
}).await
}
async fn get_token(&mut self) -> Option<JwtToken> {
async fn get_token(&mut self) -> Option<String> {
self.database.lock().await
.with_settings(|settings| {
match settings.get::<JwtToken>(SettingsKey::TOKEN) {
match settings.get::<String>(SettingsKey::TOKEN) {
Ok(token) => token,
Err(e) => {
log::warn!("Failed to get token from settings: {}", e);
@@ -67,7 +67,7 @@ impl AuthenticationStore for DatabaseAuthenticationStore {
}).await
}
async fn set_token(&mut self, token: JwtToken) {
async fn set_token(&mut self, token: String) {
self.database.lock().await
.with_settings(|settings| settings.put(SettingsKey::TOKEN, &token)).await.unwrap_or_else(|e| {
log::error!("Failed to set token: {}", e);