1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-21 23:00:50 +03:00

handlers: remove most usage of anyhow

This commit is contained in:
Quentin Gliech
2022-12-08 12:46:56 +01:00
parent a836cc864a
commit 68890b7291
24 changed files with 100 additions and 139 deletions

View File

@@ -41,7 +41,7 @@ pub(crate) async fn get(
Query(query): Query<OptionalPostAuthAction>,
cookie_jar: PrivateCookieJar<Encrypter>,
) -> Result<Response, FancyError> {
let (clock, mut rng) = crate::rng_and_clock()?;
let (clock, mut rng) = crate::clock_and_rng();
let mut conn = pool.acquire().await?;
let (csrf_token, cookie_jar) = cookie_jar.csrf_token(clock.now(), &mut rng);
@@ -81,7 +81,7 @@ pub(crate) async fn post(
cookie_jar: PrivateCookieJar<Encrypter>,
Form(form): Form<ProtectedForm<ReauthForm>>,
) -> Result<Response, FancyError> {
let (clock, mut rng) = crate::rng_and_clock()?;
let (clock, mut rng) = crate::clock_and_rng();
let mut txn = pool.begin().await?;
let form = cookie_jar.verify_form(clock.now(), form)?;