temp.js 573 B

12345678910111213
  1. const client_id = "86b57478283e4fa08dec17a50a307a8c";
  2. const redirect_uri = "http://127.0.0.1:4321/api/spotify/callback.json";
  3. const scopes = "user-read-currently-playing user-read-playback-state";
  4. const authUrl = new URL("https://accounts.spotify.com/authorize");
  5. authUrl.searchParams.append("client_id", client_id);
  6. authUrl.searchParams.append("response_type", "code");
  7. authUrl.searchParams.append("redirect_uri", redirect_uri);
  8. authUrl.searchParams.append("scope", scopes);
  9. // Redirect user to this URL
  10. console.log("Visit this URL to authorize:", authUrl.toString());