Skip to content

Commit e0a14e5

Browse files
committed
hide lastfm session keys for other users
1 parent 8136e35 commit e0a14e5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/api/settings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from app.lib.index import index_everything
1010
from app.settings import Info
1111
from app.config import UserConfig
12+
from app.utils.auth import get_current_userid
1213

1314
bp_tag = Tag(name="Settings", description="Customize stuff")
1415
api = APIBlueprint("settings", __name__, url_prefix="/notsettings", abp_tags=[bp_tag])
@@ -98,6 +99,10 @@ def get_all_settings():
9899
config["plugins"] = plugins
99100
config["version"] = Info.SWINGMUSIC_APP_VERSION
100101

102+
# hide lastfmSessionKeys for other users
103+
current_user = get_current_userid()
104+
config["lastfmSessionKey"] = config["lastfmSessionKeys"].get(str(current_user), "")
105+
del config["lastfmSessionKeys"]
101106
return config
102107

103108

0 commit comments

Comments
 (0)