modified: app.py
modified: locales/de-DE.json modified: locales/en-EN.json modified: templates/playlists.html
This commit is contained in:
10
app.py
10
app.py
@@ -103,6 +103,12 @@ def callback():
|
||||
code = request.args.get('code')
|
||||
token_info = sp_oauth.get_access_token(code)
|
||||
session["token_info"] = token_info
|
||||
|
||||
# Hole User-Infos und speichere sie in der Session
|
||||
sp = spotipy.Spotify(auth=token_info['access_token'])
|
||||
user = sp.current_user()
|
||||
session["user"] = user
|
||||
|
||||
return redirect("/playlists")
|
||||
|
||||
@app.route("/playlists")
|
||||
@@ -266,8 +272,8 @@ def toggle_playback():
|
||||
|
||||
@app.route('/logout')
|
||||
def logout():
|
||||
session.pop('user', None)
|
||||
return redirect(url_for('index'))
|
||||
session.clear()
|
||||
return redirect(url_for('home'))
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
|
||||
@@ -36,5 +36,6 @@
|
||||
"artist": "Künstler",
|
||||
"album": "Album",
|
||||
"year": "Jahr",
|
||||
"open_on_spotify": "Auf Spotify öffnen"
|
||||
"open_on_spotify": "Auf Spotify öffnen",
|
||||
"logout": "Abmelden"
|
||||
}
|
||||
@@ -36,5 +36,6 @@
|
||||
"artist": "Artist",
|
||||
"album": "Album",
|
||||
"year": "Year",
|
||||
"open_on_spotify": "Open on Spotify"
|
||||
"open_on_spotify": "Open on Spotify",
|
||||
"logout": "Logout"
|
||||
}
|
||||
@@ -54,6 +54,9 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a href="{{ url_for('logout') }}" class="logout-btn" style="position:absolute;top:20px;right:30px;">
|
||||
{{ translations['logout'] if translations['logout'] else 'Logout' }}
|
||||
</a>
|
||||
<div class="playlist-container">
|
||||
<h2>{{ translations['choose_playlist'] }}</h2>
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user