Fix bug were possible error is logged even if it hadn't occured

This commit is contained in:
Matthew Gordon 2024-03-04 10:58:48 -04:00
parent 7f7277da2d
commit fd770124ae
1 changed files with 1 additions and 3 deletions

View File

@ -115,9 +115,7 @@ async fn post_create_first_admin_user<D: Database>(
.await?;
let user = authenticate_user_with_password(&db, user, &params.password)
.await?
.ok_or(Error::new_unexpected(
"Could not authenticate newly-created user.",
))?;
.ok_or_else(|| Error::new_unexpected("Could not authenticate newly-created user."))?;
Ok((
cookie_jar
.add(Cookie::build(("jwt", create_jwt_for_user(&user)?)).same_site(SameSite::Strict)),