From e0a14e52db015019249cd520006cb791064a255a Mon Sep 17 00:00:00 2001 From: cwilvx Date: Mon, 30 Dec 2024 21:07:44 +0300 Subject: [PATCH] hide lastfm session keys for other users --- app/api/settings.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/api/settings.py b/app/api/settings.py index c09e6b6e..ead9ecdc 100644 --- a/app/api/settings.py +++ b/app/api/settings.py @@ -9,6 +9,7 @@ from app.db.userdata import PluginTable from app.lib.index import index_everything from app.settings import Info from app.config import UserConfig +from app.utils.auth import get_current_userid bp_tag = Tag(name="Settings", description="Customize stuff") api = APIBlueprint("settings", __name__, url_prefix="/notsettings", abp_tags=[bp_tag]) @@ -98,6 +99,10 @@ def get_all_settings(): config["plugins"] = plugins config["version"] = Info.SWINGMUSIC_APP_VERSION + # hide lastfmSessionKeys for other users + current_user = get_current_userid() + config["lastfmSessionKey"] = config["lastfmSessionKeys"].get(str(current_user), "") + del config["lastfmSessionKeys"] return config