diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-13 15:53:41 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-13 15:53:41 -0300 |
commit | a81ae28db34412c298ececc64319a9cf993c18f3 (patch) | |
tree | 0c0047e69c027051c171735113e16b50c3c67863 | |
parent | 1e9d1c9ff00f1269b17bc4dcf3004b0edcf6fde3 (diff) |
Handle correctly a logout problem. Closes #3774.
Also remove preferences button disable, we don't need that.
-rw-r--r-- | changes/bug-3774_fix-logout-error | 2 | ||||
-rw-r--r-- | src/leap/bitmask/crypto/srpauth.py | 1 | ||||
-rw-r--r-- | src/leap/bitmask/gui/mainwindow.py | 17 |
3 files changed, 13 insertions, 7 deletions
diff --git a/changes/bug-3774_fix-logout-error b/changes/bug-3774_fix-logout-error new file mode 100644 index 00000000..ce0951f0 --- /dev/null +++ b/changes/bug-3774_fix-logout-error @@ -0,0 +1,2 @@ + o Catch logout problem, display a user message and allow log back in after a + successful logout if there was a logout error before. Closes #3774. diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index 41ce130a..776fb2cc 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -553,6 +553,7 @@ class SRPAuth(QtCore.QObject): except Exception as e: logger.warning("Something went wrong with the logout: %r" % (e,)) + raise else: self.set_session_id(None) self.set_uid(None) diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 2942d4c8..c0983b67 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -1451,13 +1451,16 @@ class MainWindow(QtGui.QMainWindow): Switches the stackedWidget back to the login stage after logging out """ - self._logged_user = None - self.ui.action_log_out.setEnabled(False) - self.ui.stackedWidget.setCurrentIndex(self.LOGIN_INDEX) - self._login_widget.set_password("") - self._login_widget.set_enabled(True) - self._login_widget.set_status("") - self.ui.btnPreferences.setEnabled(False) + if ok: + self._logged_user = None + self.ui.action_log_out.setEnabled(False) + self.ui.stackedWidget.setCurrentIndex(self.LOGIN_INDEX) + self._login_widget.set_password("") + self._login_widget.set_enabled(True) + self._login_widget.set_status("") + else: + status_text = self.tr("Something went wrong with the logout.") + self._status_panel.set_global_status(status_text, error=True) def _intermediate_stage(self, data): """ |