Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
119c9c10
Unverified
Commit
119c9c10
authored
5 years ago
by
Aaron
Browse files
Options
Downloads
Patches
Plain Diff
Get rid of try except
Signed-off-by:
Aaron Raimist
<
aaron@raim.ist
>
parent
0b4f4cb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/rest/client/v1/logout.py
+9
-16
9 additions, 16 deletions
synapse/rest/client/v1/logout.py
with
9 additions
and
16 deletions
synapse/rest/client/v1/logout.py
+
9
−
16
View file @
119c9c10
...
...
@@ -38,23 +38,16 @@ class LogoutRestServlet(ClientV1RestServlet):
@defer.inlineCallbacks
def
on_POST
(
self
,
request
):
try
:
requester
=
yield
self
.
auth
.
get_user_by_req
(
request
)
except
AuthError
as
e
:
# this implies the access token has already been deleted.
defer
.
returnValue
((
e
.
code
,
{
"
errcode
"
:
e
.
errcode
,
"
error
"
:
e
.
msg
}))
requester
=
yield
self
.
auth
.
get_user_by_req
(
request
)
if
requester
.
device_id
is
None
:
# the acccess token wasn't associated with a device.
# Just delete the access token
access_token
=
self
.
_auth
.
get_access_token_from_request
(
request
)
yield
self
.
_auth_handler
.
delete_access_token
(
access_token
)
else
:
if
requester
.
device_id
is
None
:
# the acccess token wasn't associated with a device.
# Just delete the access token
access_token
=
self
.
_auth
.
get_access_token_from_request
(
request
)
yield
self
.
_auth_handler
.
delete_access_token
(
access_token
)
else
:
yield
self
.
_device_handler
.
delete_device
(
requester
.
user
.
to_string
(),
requester
.
device_id
)
yield
self
.
_device_handler
.
delete_device
(
requester
.
user
.
to_string
(),
requester
.
device_id
)
defer
.
returnValue
((
200
,
{}))
...
...
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