if access token expired, use refresh token, and get new access + refresh tokens

This commit is contained in:
Philippe Loctaux 2023-03-19 20:03:30 +01:00
parent 9172155893
commit 8db0bbb874
12 changed files with 462 additions and 41 deletions

View file

@ -96,4 +96,13 @@ impl User {
.await?
.map(Self::from))
}
pub async fn get_one_from_refresh_token(
conn: impl SqliteExecutor<'_>,
token: &str,
) -> Result<Option<Self>, Error> {
Ok(DatabaseUsers::get_one_from_refresh_token(conn, token)
.await?
.map(Self::from))
}
}