revoke all refresh tokens and use all authorization codes for user
This commit is contained in:
parent
5100aa1b4e
commit
009b8664fd
11 changed files with 94 additions and 8 deletions
|
|
@ -54,4 +54,11 @@ impl RefreshToken {
|
|||
pub async fn revoke(self, conn: impl SqliteExecutor<'_>) -> Result<Option<()>, Error> {
|
||||
Ok(DatabaseRefreshTokens::revoke(conn, &self.token).await?)
|
||||
}
|
||||
|
||||
pub async fn revoke_all_for_user(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
user: &UserID,
|
||||
) -> Result<Option<()>, Error> {
|
||||
Ok(DatabaseRefreshTokens::revoke_all_for_user(conn, user.as_ref()).await?)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,4 +32,8 @@ impl RefreshToken {
|
|||
pub fn is_revoked(&self) -> bool {
|
||||
self.revoked_at.is_some()
|
||||
}
|
||||
|
||||
pub fn user(&self) -> &UserID {
|
||||
&self.user
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue