mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-22 01:25:44 +03:00
Dedicated error code for failed 3pid auth verification
This commit is contained in:
parent
0eb61a3d16
commit
03eb4adc6e
2 changed files with 4 additions and 1 deletions
|
@ -39,6 +39,7 @@ class Codes(object):
|
|||
MISSING_PARAM = "M_MISSING_PARAM",
|
||||
TOO_LARGE = "M_TOO_LARGE",
|
||||
EXCLUSIVE = "M_EXCLUSIVE"
|
||||
THREEPID_AUTH_FAILED = "M_THREEPID_AUTH_FAILED"
|
||||
|
||||
|
||||
class CodeMessageException(RuntimeError):
|
||||
|
|
|
@ -126,7 +126,9 @@ class ThreepidRestServlet(RestServlet):
|
|||
threepid = yield self.identity_handler.threepid_from_creds(threePidCreds)
|
||||
|
||||
if not threepid:
|
||||
raise SynapseError(400, "Failed to auth 3pid")
|
||||
raise SynapseError(
|
||||
400, "Failed to auth 3pid", Codes.THREEPID_AUTH_FAILED
|
||||
)
|
||||
|
||||
for reqd in ['medium', 'address', 'validatedAt']:
|
||||
if reqd not in threepid:
|
||||
|
|
Loading…
Reference in a new issue