mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:06:07 -04:00
Implement MSC3069: Guest support on whoami (#9655)
This commit is contained in:
parent
5279b9161b
commit
8cef1ab2ac
3 changed files with 51 additions and 7 deletions
|
@ -878,9 +878,13 @@ class WhoamiRestServlet(RestServlet):
|
|||
self.auth = hs.get_auth()
|
||||
|
||||
async def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
|
||||
requester = await self.auth.get_user_by_req(request)
|
||||
requester = await self.auth.get_user_by_req(request, allow_guest=True)
|
||||
|
||||
response = {"user_id": requester.user.to_string()}
|
||||
response = {
|
||||
"user_id": requester.user.to_string(),
|
||||
# MSC: https://github.com/matrix-org/matrix-doc/pull/3069
|
||||
"org.matrix.msc3069.is_guest": bool(requester.is_guest),
|
||||
}
|
||||
|
||||
# Appservices and similar accounts do not have device IDs
|
||||
# that we can report on, so exclude them for compliance.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue