From 612a15ec7d3553a36103d34b8400a6c5e2ecae83 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 20 Jun 2025 09:47:02 +0100 Subject: [PATCH] Rename PasswordVerificationFailed to PasswordMismatch --- crates/handlers/src/compat/login.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/crates/handlers/src/compat/login.rs b/crates/handlers/src/compat/login.rs index e3c3d9b69..22a74a405 100644 --- a/crates/handlers/src/compat/login.rs +++ b/crates/handlers/src/compat/login.rs @@ -194,7 +194,7 @@ pub enum RouteError { NoPassword, #[error("password verification failed")] - PasswordVerificationFailed, + PasswordMismatch, #[error("request rate limited")] RateLimited(#[from] PasswordCheckLimitedError), @@ -248,13 +248,11 @@ impl IntoResponse for RouteError { error: "Missing property 'identifier", status: StatusCode::BAD_REQUEST, }, - Self::UserNotFound | Self::NoPassword | Self::PasswordVerificationFailed => { - MatrixError { - errcode: "M_FORBIDDEN", - error: "Invalid username/password", - status: StatusCode::FORBIDDEN, - } - } + Self::UserNotFound | Self::NoPassword | Self::PasswordMismatch => MatrixError { + errcode: "M_FORBIDDEN", + error: "Invalid username/password", + status: StatusCode::FORBIDDEN, + }, Self::LoginTookTooLong => MatrixError { errcode: "M_FORBIDDEN", error: "Login token expired", @@ -607,7 +605,7 @@ async fn user_password_login( } PasswordVerificationResult::Success(None) => {} PasswordVerificationResult::Failure => { - return Err(RouteError::PasswordVerificationFailed); + return Err(RouteError::PasswordMismatch); } }