summary refs log tree commit diff
path: root/synapse/rest/client/v1
diff options
context:
space:
mode:
authorAaron Raimist <aaron@raim.ist>2019-05-24 16:32:21 -0500
committerAaron Raimist <aaron@raim.ist>2019-05-24 16:32:27 -0500
commit56f07d980a9d3b3b8e2cc196e5d630abd98be122 (patch)
treebc669f739401fc0889e4d7c51fb2e1a84279c37f /synapse/rest/client/v1
parentFix appservice timestamp massaging (#5233) (diff)
downloadsynapse-56f07d980a9d3b3b8e2cc196e5d630abd98be122.tar.xz
Show correct error when logging out and access token is missing
Signed-off-by: Aaron Raimist <aaron@raim.ist>
Diffstat (limited to 'synapse/rest/client/v1')
-rw-r--r--synapse/rest/client/v1/logout.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/rest/client/v1/logout.py b/synapse/rest/client/v1/logout.py
index 430c692336..317f52cb56 100644
--- a/synapse/rest/client/v1/logout.py
+++ b/synapse/rest/client/v1/logout.py
@@ -40,11 +40,11 @@ class LogoutRestServlet(ClientV1RestServlet):
     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: