Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove user credential from keyring #2627

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Changes from all 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
7 changes: 6 additions & 1 deletion mslib/msui/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
from PyQt5.QtWidgets import QDialog, QFileDialog, QMessageBox
from PyQt5.QtGui import QPixmap

from mslib.utils.auth import get_password_from_keyring, save_password_to_keyring
from mslib.utils.auth import get_password_from_keyring, save_password_to_keyring, del_password_from_keyring
from mslib.utils.verify_user_token import verify_user_token as _verify_user_token
from mslib.utils.verify_waypoint_data import verify_waypoint_data
from mslib.utils.qt import get_open_filename, get_save_filename, dropEvent, dragEnterEvent, show_popup
Expand Down Expand Up @@ -937,6 +937,11 @@ def delete_account(self, _=None):
if reply == QMessageBox.No:
return
try:
auth_name = config_loader(dataset="MSCOLAB_auth_user_name")
del_password_from_keyring(self.mscolab_server_url, self.email)
if auth_name:
del_password_from_keyring(f"MSCOLAB_AUTH_{self.mscolab_server_url}", auth_name)
modify_config_file({"MSCOLAB_auth_user_name": None})
response = self.conn.request_post("delete_own_account")
except requests.exceptions.RequestException as ex:
raise MSColabConnectionError(f"Some error occurred ({ex})! Please reconnect.")
Expand Down
Loading