Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
24232514
Commit
24232514
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Remove threepid binding if id server returns 400/404/501
parent
c75e2017
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/identity.py
+10
-9
10 additions, 9 deletions
synapse/handlers/identity.py
with
10 additions
and
9 deletions
synapse/handlers/identity.py
+
10
−
9
View file @
24232514
...
...
@@ -227,23 +227,24 @@ class IdentityHandler(BaseHandler):
content
,
headers
,
)
yield
self
.
store
.
remove_user_bound_threepid
(
user_id
=
mxid
,
medium
=
threepid
[
"
medium
"
],
address
=
threepid
[
"
address
"
],
id_server
=
id_server
,
)
changed
=
True
except
HttpResponseException
as
e
:
changed
=
False
if
e
.
code
in
(
400
,
404
,
501
,):
# The remote server probably doesn't support unbinding (yet)
logger
.
warn
(
"
Received %d response while unbinding threepid
"
,
e
.
code
)
defer
.
returnValue
(
False
)
else
:
logger
.
error
(
"
Failed to unbind threepid on identity server: %s
"
,
e
)
raise
SynapseError
(
502
,
"
Failed to contact identity server
"
)
defer
.
returnValue
(
True
)
yield
self
.
store
.
remove_user_bound_threepid
(
user_id
=
mxid
,
medium
=
threepid
[
"
medium
"
],
address
=
threepid
[
"
address
"
],
id_server
=
id_server
,
)
defer
.
returnValue
(
changed
)
@defer.inlineCallbacks
def
requestEmailToken
(
self
,
id_server
,
email
,
client_secret
,
send_attempt
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment