Skip to content

Commit 612a15e

Browse files
committed
Rename PasswordVerificationFailed to PasswordMismatch
1 parent 6f167a8 commit 612a15e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

crates/handlers/src/compat/login.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub enum RouteError {
194194
NoPassword,
195195

196196
#[error("password verification failed")]
197-
PasswordVerificationFailed,
197+
PasswordMismatch,
198198

199199
#[error("request rate limited")]
200200
RateLimited(#[from] PasswordCheckLimitedError),
@@ -248,13 +248,11 @@ impl IntoResponse for RouteError {
248248
error: "Missing property 'identifier",
249249
status: StatusCode::BAD_REQUEST,
250250
},
251-
Self::UserNotFound | Self::NoPassword | Self::PasswordVerificationFailed => {
252-
MatrixError {
253-
errcode: "M_FORBIDDEN",
254-
error: "Invalid username/password",
255-
status: StatusCode::FORBIDDEN,
256-
}
257-
}
251+
Self::UserNotFound | Self::NoPassword | Self::PasswordMismatch => MatrixError {
252+
errcode: "M_FORBIDDEN",
253+
error: "Invalid username/password",
254+
status: StatusCode::FORBIDDEN,
255+
},
258256
Self::LoginTookTooLong => MatrixError {
259257
errcode: "M_FORBIDDEN",
260258
error: "Login token expired",
@@ -607,7 +605,7 @@ async fn user_password_login(
607605
}
608606
PasswordVerificationResult::Success(None) => {}
609607
PasswordVerificationResult::Failure => {
610-
return Err(RouteError::PasswordVerificationFailed);
608+
return Err(RouteError::PasswordMismatch);
611609
}
612610
}
613611

0 commit comments

Comments
 (0)