Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 55 additions & 79 deletions src/web/callback.html
Original file line number Diff line number Diff line change
@@ -1,82 +1,58 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Spotify Authorization Callback</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}

.container {
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
color: #1db954;
text-align: center;
margin-bottom: 30px;
}

.info {
background-color: #d1ecf1;
color: #0c5460;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}

.state-value {
font-family: monospace;
font-size: 18px;
background-color: #f8f9fa;
padding: 10px;
border-radius: 5px;
border: 1px solid #ddd;
word-break: break-all;
}

.success {
background-color: #d4edda;
color: #155724;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}

.error {
background-color: #f8d7da;
color: #721c24;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>🎵 Spotify Authorization</h1>

<div class="info">
<p><strong>Username:</strong> <span id="username"></span></p>
<p><strong>Current URL:</strong> <span id="current-url"></span></p>
<p><strong>Page Loaded:</strong> <span id="load-time"></span></p>
</div>

<div id="state-section">
<h2>State Parameter</h2>
<div id="state-verification" style="display: none"></div>
</div>
</div>

<script src="callbackScript.js"></script>
</body>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Spotify Authorization Callback</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}

.container {
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
color: #1db954;
text-align: center;
margin-bottom: 30px;
}

.success {
background-color: #d4edda;
color: #155724;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}

.error {
background-color: #f8d7da;
color: #721c24;
padding: 15px;
border-radius: 5px;
margin: 10px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>🎵 Spotify Authorization</h1>

<div id="state-section">
<h2>State Parameter</h2>
<div id="state-verification" style="display: none"></div>
</div>
</div>

<script src="callbackScript.js"></script>
</body>
</html>
4 changes: 0 additions & 4 deletions src/web/callbackScript.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Display debug info
document.getElementById('current-url').textContent = window.location.href;
document.getElementById('load-time').textContent = new Date().toLocaleString();

// Extract and display the state parameter, and verify it matches the original
window.addEventListener('load', function () {
const urlParams = new URLSearchParams(window.location.search);
Expand Down
6 changes: 0 additions & 6 deletions src/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ <h2>Create Playlist</h2>
</button>
<div id="playlist-result" style="margin-top: 10px;"></div>
</div>

<div id="debug" class="section">
<h3>Debug Info</h3>
<p><strong>Current URL:</strong> <span id="current-url"></span></p>
<p><strong>Page loaded:</strong> <span id="load-time"></span></p>
</div>
</div>

<script src="script.js"></script>
Expand Down
4 changes: 0 additions & 4 deletions src/web/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ const CONFIG = {
SPOTIFY_SCOPES: 'playlist-modify-private'
};

// Debug info
document.getElementById('current-url').textContent = window.location.href;
document.getElementById('load-time').textContent = new Date().toLocaleString();

// Generate random string on page load
const state = crypto.randomUUID();
sessionStorage.setItem('state', state);
Expand Down