mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-04-25 09:02:19 +00:00
Compare commits
6 Commits
ginger/upd
...
nex/fix/wh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a2a1b6240 | ||
|
|
fb536ca1ce | ||
|
|
d22d47954f | ||
|
|
d48cc46643 | ||
|
|
8cf2d175d6 | ||
|
|
205ac22008 |
1
changelog.d/1276.bugfix
Normal file
1
changelog.d/1276.bugfix
Normal file
@@ -0,0 +1 @@
|
||||
Fixed the whoami endpoint returning HTTP 404 instead of HTTP 403, which confused some appservices. Contributed by @nex.
|
||||
2814
docs/admin_reference.md
Normal file
2814
docs/admin_reference.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||
///
|
||||
@@ -733,11 +733,17 @@ pub(crate) async fn whoami_route(
|
||||
State(services): State<crate::State>,
|
||||
body: Ruma<whoami::v3::Request>,
|
||||
) -> Result<whoami::v3::Response> {
|
||||
let 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();
|
||||
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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user