revoked_access_tokens.rs
1use super::*;
2
3impl LlmDatabase {
4 /// Returns whether the access token with the given `jti` has been revoked.
5 pub async fn is_access_token_revoked(&self, jti: &str) -> Result<bool> {
6 self.transaction(|tx| async move {
7 Ok(revoked_access_token::Entity::find()
8 .filter(revoked_access_token::Column::Jti.eq(jti))
9 .one(&*tx)
10 .await?
11 .is_some())
12 })
13 .await
14 }
15}