fix: move ownership into auth fn

This commit is contained in:
Per Stark
2025-03-21 08:01:04 +01:00
parent b4cf020f36
commit 42e63600a1
4 changed files with 8 additions and 11 deletions
+1 -1
View File
@@ -127,7 +127,7 @@ pub async fn change_password(
Form(form): Form<NewPasswordForm>,
) -> Result<impl IntoResponse, HtmlError> {
// Authenticate to make sure the password matches
let authenticated_user = User::authenticate(user.email, form.old_password, &state.db).await?;
let authenticated_user = User::authenticate(&user.email, &form.old_password, &state.db).await?;
User::patch_password(&authenticated_user.email, &form.new_password, &state.db).await?;