ezidam: added logout page, added RefreshToken guard
This commit is contained in:
parent
49b3a3d1fe
commit
5100aa1b4e
10 changed files with 205 additions and 3 deletions
|
|
@ -41,4 +41,17 @@ impl RefreshToken {
|
|||
)
|
||||
.await?)
|
||||
}
|
||||
|
||||
pub async fn get_one(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
token: &str,
|
||||
) -> Result<Option<Self>, Error> {
|
||||
Ok(DatabaseRefreshTokens::get_one(conn, token)
|
||||
.await?
|
||||
.map(Self::from))
|
||||
}
|
||||
|
||||
pub async fn revoke(self, conn: impl SqliteExecutor<'_>) -> Result<Option<()>, Error> {
|
||||
Ok(DatabaseRefreshTokens::revoke(conn, &self.token).await?)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue