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
|
|
@ -50,4 +50,11 @@ impl AuthorizationCode {
|
|||
pub async fn use_code(self, conn: impl SqliteExecutor<'_>) -> Result<Option<()>, Error> {
|
||||
Ok(DatabaseAuthorizationCodes::use_code(conn, &self.code).await?)
|
||||
}
|
||||
|
||||
pub async fn use_all_for_user(
|
||||
&self,
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
) -> Result<Option<()>, Error> {
|
||||
Ok(DatabaseAuthorizationCodes::use_all_for_user(conn, self.user.as_ref()).await?)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,7 @@ impl AuthorizationCode {
|
|||
pub fn has_expired(&self) -> bool {
|
||||
self.expires_at < Utc::now()
|
||||
}
|
||||
pub fn user(&self) -> &UserID {
|
||||
&self.user
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue