ezidam: refactor jwt and refresh token generate in "tokens" mod
This commit is contained in:
parent
23b1e3ea4f
commit
9687116063
13 changed files with 179 additions and 59 deletions
|
|
@ -63,4 +63,17 @@ impl Keys {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn revoke_all_except_one(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
exception: &str,
|
||||
) -> Result<Option<()>, Error> {
|
||||
let query: SqliteQueryResult =
|
||||
sqlx::query_file!("queries/keys/revoke_all_except_one.sql", exception)
|
||||
.execute(conn)
|
||||
.await
|
||||
.map_err(handle_error)?;
|
||||
|
||||
Ok((query.rows_affected() >= 1).then_some(()))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue