ezidam: apps: archive, and revoke refresh tokens associated with app
This commit is contained in:
parent
956f28f7e5
commit
e06bd31b4c
11 changed files with 159 additions and 2 deletions
|
|
@ -136,4 +136,13 @@ impl Apps {
|
|||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
|
||||
pub async fn archive(conn: impl SqliteExecutor<'_>, id: &str) -> Result<Option<()>, Error> {
|
||||
let query: SqliteQueryResult = sqlx::query_file!("queries/apps/archive.sql", id)
|
||||
.execute(conn)
|
||||
.await
|
||||
.map_err(handle_error)?;
|
||||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,4 +96,17 @@ impl RefreshTokens {
|
|||
|
||||
Ok((query.rows_affected() == 1).then_some(()))
|
||||
}
|
||||
|
||||
pub async fn revoke_all_for_app(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
app: &str,
|
||||
) -> Result<Option<()>, Error> {
|
||||
let query: SqliteQueryResult =
|
||||
sqlx::query_file!("queries/refresh_tokens/revoke_all_for_app.sql", app)
|
||||
.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