spotify-sorter-node/index.html
2021-09-17 22:01:16 +02:00

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>