From 1b41e35f1d541bba3c39fd3e6189da560e19d4c6 Mon Sep 17 00:00:00 2001 From: strawberry Date: Tue, 23 Apr 2024 18:59:14 -0400 Subject: [PATCH] use HTTP 403 (forbidden) instead of HTTP 400 for membership failed auth checks Signed-off-by: strawberry --- src/api/client_server/membership.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/client_server/membership.rs b/src/api/client_server/membership.rs index afbe5ab4..8c57630c 100644 --- a/src/api/client_server/membership.rs +++ b/src/api/client_server/membership.rs @@ -967,7 +967,7 @@ pub(crate) async fn join_room_by_id_helper( .add_pdu_outlier(&event_id, &value)?; } - info!("Running send_join auth check"); + debug!("Running send_join auth check"); let auth_check = state_res::event_auth::auth_check( &state_res::RoomVersion::new(&room_version_id).expect("room version is supported"), @@ -991,11 +991,11 @@ pub(crate) async fn join_room_by_id_helper( ) .map_err(|e| { warn!("Auth check failed: {e}"); - Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed") + Error::BadRequest(ErrorKind::forbidden(), "Auth check failed") })?; if !auth_check { - return Err(Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed")); + return Err(Error::BadRequest(ErrorKind::forbidden(), "Auth check failed")); } info!("Saving state from send_join");