This commit is contained in:
Andras Schmelczer 2026-02-15 22:39:49 +00:00
parent 03445188ea
commit 524580eb25
102 changed files with 36625 additions and 1295 deletions

View file

@ -19,6 +19,12 @@ pub struct PocketBaseUser {
pub email: String,
#[serde(default)]
pub verified: bool,
#[serde(default)]
pub is_admin: bool,
#[serde(default)]
pub subscription: String,
#[serde(default)]
pub newsletter: bool,
}
#[derive(Clone)]
@ -58,6 +64,12 @@ impl TokenCache {
}
map.insert(token, (user, Instant::now()));
}
/// Remove all cached tokens for a given user ID so the next request re-validates.
pub fn invalidate_by_user_id(&self, user_id: &str) {
let mut map = self.entries.write();
map.retain(|_, (user, _)| user.id != user_id);
}
}
#[derive(Deserialize)]