From d22d47954f78d48190b518ef3072d0d17e67f7d7 Mon Sep 17 00:00:00 2001 From: timedout Date: Fri, 9 Jan 2026 00:44:38 +0000 Subject: [PATCH] fix: Return 403 instead of 404 at /_matrix/client/v3/account/whoami --- src/api/client/account.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/api/client/account.rs b/src/api/client/account.rs index d2fb80f2..30f3cdd3 100644 --- a/src/api/client/account.rs +++ b/src/api/client/account.rs @@ -724,7 +724,7 @@ pub(crate) async fn change_password_route( Ok(change_password::v3::Response {}) } -/// # `GET _matrix/client/r0/account/whoami` +/// # `GET /_matrix/client/v3/account/whoami` /// /// Get `user_id` of the sender user. /// @@ -736,8 +736,13 @@ pub(crate) async fn whoami_route( Ok(whoami::v3::Response { user_id: body.sender_user().to_owned(), device_id: body.sender_device.clone(), - is_guest: services.users.is_deactivated(body.sender_user()).await? - && body.appservice_info.is_none(), + is_guest: services + .users + .is_deactivated(body.sender_user()) + .await + .map_err(|_| { + err!(Request(Forbidden("Application service has not registered this user."))) + })? && body.appservice_info.is_none(), }) }