From ab6cb4ad2d1e940a9fe10c73fc8dde0b5b33d7d0 Mon Sep 17 00:00:00 2001 From: strawberry Date: Sun, 21 Jan 2024 20:30:09 -0500 Subject: [PATCH] switch back to expect for sender_user as far as i can tell, it will return a normal error in the auth token handling code so this is fine. we also shouldnt assume all errors from this are access_token related. Signed-off-by: strawberry --- src/api/client_server/directory.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/api/client_server/directory.rs b/src/api/client_server/directory.rs index 8f4c3030..dd34d678 100644 --- a/src/api/client_server/directory.rs +++ b/src/api/client_server/directory.rs @@ -70,10 +70,7 @@ pub async fn get_public_rooms_route( .config .allow_public_room_directory_without_auth { - let _sender_user = body - .sender_user - .as_ref() - .ok_or_else(|| Error::BadRequest(ErrorKind::MissingToken, "Missing access token."))?; + let _sender_user = body.sender_user.as_ref().expect("user is authenticated"); } let response = get_public_rooms_filtered_helper(