Show correct error when logging out and access token is missing

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist 2019-05-24 16:32:21 -05:00
parent dd64b9dbdd
commit 56f07d980a
No known key found for this signature in database
GPG Key ID: 37419210002890EF

View File

@ -40,11 +40,11 @@ class LogoutRestServlet(ClientV1RestServlet):
def on_POST(self, request): def on_POST(self, request):
try: try:
requester = yield self.auth.get_user_by_req(request) requester = yield self.auth.get_user_by_req(request)
except AuthError: except AuthError as e:
# this implies the access token has already been deleted. # this implies the access token has already been deleted.
defer.returnValue((401, { defer.returnValue((e.code, {
"errcode": "M_UNKNOWN_TOKEN", "errcode": e.errcode,
"error": "Access Token unknown or expired" "error": e.msg
})) }))
else: else:
if requester.device_id is None: if requester.device_id is None: