updated api to create totp struct, get totp secret directly if it exists

This commit is contained in:
Philippe Loctaux 2023-05-01 11:48:57 +02:00
parent e70d035c86
commit f891d2f940
4 changed files with 18 additions and 20 deletions

View file

@ -50,7 +50,10 @@ impl User {
)
}
async fn get_by_id(conn: impl SqliteExecutor<'_>, id: &UserID) -> Result<Option<Self>, Error> {
pub async fn get_by_id(
conn: impl SqliteExecutor<'_>,
id: &UserID,
) -> Result<Option<Self>, Error> {
Ok(DatabaseUsers::get_one_by_id(conn, &id.0)
.await?
.map(Self::from))