From 1f17b78371048451856c33a35f8b9030e42514e6 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 3 Aug 2016 10:01:23 +0100 Subject: [PATCH] log if we can't log out --- src/Lifecycle.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Lifecycle.js b/src/Lifecycle.js index be09551c88..24073fe7a6 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -54,14 +54,17 @@ function logout() { } return MatrixClientPeg.get().logout().then(_onLoggedOut, - // Just throwing an error here is going to be very unhelpful - // if you're trying to log out because your server's down and - // you want to log into a different server, so just forget the - // access token. It's annoying that this will leave the access - // token still valid, but we should fix this by having access - // tokens expire (and if you really think you've been compromised, - // change your password). - _onLoggedOut + (err) => { + // Just throwing an error here is going to be very unhelpful + // if you're trying to log out because your server's down and + // you want to log into a different server, so just forget the + // access token. It's annoying that this will leave the access + // token still valid, but we should fix this by having access + // tokens expire (and if you really think you've been compromised, + // change your password). + console.log("Failed to call logout API: token will not be invalidated"); + _onLoggedOut(); + } ); }