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

Pass the rng and clock around

This commit is contained in:
Quentin Gliech
2022-10-21 18:50:06 +02:00
parent 5c7e66a9b2
commit 559181c2c3
40 changed files with 504 additions and 218 deletions

View File

@@ -80,6 +80,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 mut txn = pool.begin().await?;
let form = cookie_jar.verify_form(form)?;
@@ -98,7 +99,7 @@ pub(crate) async fn post(
};
// TODO: recover from errors here
authenticate_session(&mut txn, &mut session, &form.password).await?;
authenticate_session(&mut txn, &mut rng, &clock, &mut session, &form.password).await?;
let cookie_jar = cookie_jar.set_session(&session);
txn.commit().await?;