fix: use Spotify public web-player token — no Premium/API account needed
Replace Client Credentials flow with Spotify's public web-player token endpoint (open.spotify.com/get_access_token) which works without any account or Premium. Remove Spotify credential fields from UI entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc1bec74a1
commit
cfa8a8cd49
4 files changed
+24
-44
No files matched your search
@@ -61,8 +61,6 @@ export function openSettings() {
|
||||
document.getElementById('s-pass').value = '';
|
||||
document.getElementById('s-lastfm').value = S.cfg.lastfmKey || '';
|
||||
document.getElementById('s-backend').value = S.cfg.backendUrl || '';
|
||||
document.getElementById('s-spotify-id').value = S.cfg.spotifyClientId || '';
|
||||
document.getElementById('s-spotify-secret').value = '';
|
||||
document.getElementById('settings-modal').classList.add('open');
|
||||
checkBackend();
|
||||
}
|
||||
@@ -74,9 +72,6 @@ export function saveSettings() {
|
||||
if(pass) S.cfg.pass = pass;
|
||||
S.cfg.lastfmKey = document.getElementById('s-lastfm').value.trim();
|
||||
S.cfg.backendUrl = document.getElementById('s-backend').value.trim().replace(/\/$/,'');
|
||||
S.cfg.spotifyClientId = document.getElementById('s-spotify-id').value.trim();
|
||||
const spSec = document.getElementById('s-spotify-secret').value;
|
||||
if (spSec) S.cfg.spotifyClientSecret = spSec;
|
||||
localStorage.setItem('ns_cfg', JSON.stringify(S.cfg));
|
||||
closeSettings(); toast('✅ Gespeichert');
|
||||
}
|
||||
|
||||
+2
-4
@@ -917,9 +917,7 @@ export function clearSpotifyPreview() {
|
||||
export async function resolveSpotifyLink() {
|
||||
const url = document.getElementById('spotify-link-input')?.value.trim();
|
||||
if (!url) return;
|
||||
if (!S.cfg.backendUrl) { toast('⚠ Backend URL in Einstellungen konfigurieren'); return; }
|
||||
if (!S.cfg.spotifyClientId) { toast('⚠ Spotify Client ID in Einstellungen eintragen'); return; }
|
||||
if (!S.cfg.spotifyClientSecret) { toast('⚠ Spotify Client Secret in Einstellungen eintragen'); return; }
|
||||
if (!S.cfg.backendUrl) { toast('⚠ Backend URL in Einstellungen konfigurieren'); return; }
|
||||
|
||||
const hint = document.getElementById('spotify-importer-hint');
|
||||
const preview = document.getElementById('spotify-preview');
|
||||
@@ -935,7 +933,7 @@ export async function resolveSpotifyLink() {
|
||||
const res = await fetch(`${S.cfg.backendUrl}/api/spotify/resolve`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ url, clientId: S.cfg.spotifyClientId, clientSecret: S.cfg.spotifyClientSecret }),
|
||||
body: JSON.stringify({ url }),
|
||||
});
|
||||
if (!res.ok) {
|
||||
const err = await res.json().catch(() => ({}));
|
||||
|
||||
Reference in new issue
Block a user