diff options
author | Neil Johnson <neil@matrix.org> | 2018-09-04 12:03:17 +0100 |
---|---|---|
committer | Neil Johnson <neil@matrix.org> | 2018-09-04 12:03:17 +0100 |
commit | c42f7fd7b9f99923d71ad064fff7d75a5fc3cd93 (patch) | |
tree | 94c28bca7974f371e6a091ed6ea459b56b3c7cb0 /synapse/rest/client/v2_alpha/register.py | |
parent | assert rather than warn (diff) | |
download | synapse-c42f7fd7b9f99923d71ad064fff7d75a5fc3cd93.tar.xz |
improve human readable error messages
Diffstat (limited to 'synapse/rest/client/v2_alpha/register.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/register.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/rest/client/v2_alpha/register.py b/synapse/rest/client/v2_alpha/register.py index 2fb4d43ccb..200b29fa38 100644 --- a/synapse/rest/client/v2_alpha/register.py +++ b/synapse/rest/client/v2_alpha/register.py @@ -75,7 +75,9 @@ class EmailRegisterRequestTokenRestServlet(RestServlet): if not check_3pid_allowed(self.hs, "email", body['email']): raise SynapseError( - 403, "Third party identifier is not allowed", Codes.THREEPID_DENIED, + 403, + "Your email domain is not authorized to register on this server", + Codes.THREEPID_DENIED, ) existingUid = yield self.hs.get_datastore().get_user_id_by_threepid( @@ -115,7 +117,9 @@ class MsisdnRegisterRequestTokenRestServlet(RestServlet): if not check_3pid_allowed(self.hs, "msisdn", msisdn): raise SynapseError( - 403, "Third party identifier is not allowed", Codes.THREEPID_DENIED, + 403, + "Phone numbers are not authorized to register on this server", + Codes.THREEPID_DENIED, ) existingUid = yield self.hs.get_datastore().get_user_id_by_threepid( @@ -373,7 +377,8 @@ class RegisterRestServlet(RestServlet): if not check_3pid_allowed(self.hs, medium, address): raise SynapseError( - 403, "Third party identifier is not allowed", + 403, + "Third party identifier (email/phone number) is not allowed", Codes.THREEPID_DENIED, ) |