mirror of
https://github.com/Noratrieb/spotify-sorter-node.git
synced 2026-01-14 08:35:12 +01:00
32 lines
747 B
HTML
32 lines
747 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Spotify Sorter</title>
|
|
</head>
|
|
<body>
|
|
You can close this window now.
|
|
<script>
|
|
const hash = window.location.hash
|
|
.substring(1)
|
|
.split("&")
|
|
.reduce((initial, item) => {
|
|
if (item) {
|
|
const parts = item.split("=");
|
|
initial[parts[0]] = decodeURIComponent(parts[1]);
|
|
}
|
|
return initial;
|
|
}, {});
|
|
window.location.hash = "";
|
|
|
|
if (hash.access_token) {
|
|
fetch("http://localhost:8080", {
|
|
method: "POST",
|
|
body: hash.access_token
|
|
})
|
|
} else {
|
|
console.error("No access_token present in hash")
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|