From 02a4bfa636a5c6b9aafcf32a15eddd6edcc149a7 Mon Sep 17 00:00:00 2001 From: oldnapalm <38410858+oldnapalm@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:15:44 -0300 Subject: [PATCH] Remove tokens when saving credentials --- zwift_offline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zwift_offline.py b/zwift_offline.py index b1b06ea..5bb529b 100644 --- a/zwift_offline.py +++ b/zwift_offline.py @@ -25,7 +25,7 @@ import xml.etree.ElementTree as ET from copy import deepcopy from functools import wraps from io import BytesIO -from shutil import copyfile +from shutil import copyfile, rmtree from logging.handlers import RotatingFileHandler from urllib.parse import quote from flask import Flask, request, jsonify, redirect, render_template, url_for, flash, session, abort, make_response, send_file, send_from_directory @@ -820,6 +820,7 @@ def garmin(username): flash("Garmin credentials can't be empty.") return render_template("garmin.html", username=current_user.username) encrypt_credentials(file, (request.form['username'], request.form['password'])) + rmtree('%s/%s/garth' % (STORAGE_DIR, current_user.player_id), ignore_errors=True) return redirect(url_for('settings', username=current_user.username)) cred = decrypt_credentials(file) return render_template("garmin.html", username=current_user.username, uname=cred[0], passw=cred[1])