summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-07-08 17:31:00 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-07-09 10:27:53 +0100
commit25fff95448ca620a60870b924907c77caa1d1dc7 (patch)
tree877a8019b5e5c9dde4cf2038364c350b822ba2a2
parentMerge pull request #5574 from matrix-org/babolivier/fix-3pid-bind (diff)
downloadsynapse-25fff95448ca620a60870b924907c77caa1d1dc7.tar.xz
Allow newly-registered users to lookup their own profiles
When a user creates an account and the 'require_auth_for_profile_requests' config flag is set, and a client that performed the registration wants to lookup the newly-created profile, the request will be denied because the user doesn't share a room with themselves yet.
-rw-r--r--synapse/handlers/profile.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py

index 7bb0d654bf..5c493b8d63 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py
@@ -462,6 +462,10 @@ class BaseProfileHandler(BaseHandler): if not self.hs.config.require_auth_for_profile_requests or not requester: return + # Always allow the user to query their own profile. + if target_user.to_string() == requester.to_string(): + return + try: requester_rooms = yield self.store.get_rooms_for_user( requester.to_string()