Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Show correct error when logging out and access token is missing #5256

Merged
merged 4 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5256.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show the correct error when logging out and access token is missing.
8 changes: 4 additions & 4 deletions synapse/rest/client/v1/logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def on_OPTIONS(self, request):
def on_POST(self, request):
try:
requester = yield self.auth.get_user_by_req(request)
except AuthError:
except AuthError as e:
# this implies the access token has already been deleted.
defer.returnValue((401, {
"errcode": "M_UNKNOWN_TOKEN",
"error": "Access Token unknown or expired"
defer.returnValue((e.code, {
"errcode": e.errcode,
"error": e.msg
}))
else:
if requester.device_id is None:
Expand Down