1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

storage: unify most oauth2 related errors

This commit is contained in:
Quentin Gliech
2022-12-07 20:11:49 +01:00
parent b7cad48bbd
commit 102571512e
15 changed files with 261 additions and 388 deletions

View File

@@ -27,7 +27,6 @@ use async_graphql::{
Context, Description, EmptyMutation, EmptySubscription, ID,
};
use mas_axum_utils::SessionInfo;
use mas_storage::LookupResultExt;
use sqlx::PgPool;
use self::model::{
@@ -96,9 +95,7 @@ impl RootQuery {
let database = ctx.data::<PgPool>()?;
let mut conn = database.acquire().await?;
let client = mas_storage::oauth2::client::lookup_client(&mut conn, id)
.await
.to_option()?;
let client = mas_storage::oauth2::client::lookup_client(&mut conn, id).await?;
Ok(client.map(OAuth2Client))
}