summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
Diffstat (limited to 'dist')
-rw-r--r--dist/callback.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/dist/callback.html b/dist/callback.html
new file mode 100644
index 0000000..002515c
--- /dev/null
+++ b/dist/callback.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <h1>Spotify Intersect</h1>
+ <button onclick="load_songs()">Load songs to database</button>
+ <script>
+ function getParameterByName(name) {
+ let url = window.location.href;
+ name = name.replace(/[\[\]]/g, "\\$&");
+ var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
+ results = regex.exec(url);
+ if (!results) return null;
+ if (!results[2]) return '';
+ return decodeURIComponent(results[2].replace(/\+/g, " "));
+ }
+
+ function load_songs() {
+ console.log("loading songs");
+ let token = sessionStorage.getItem('token');
+ fetch("https://kobert.dev/spotify-api/callback/" + token + "/" + getParameterByName("code")).then(console.log("finished loading songs!"));
+ //window.location = "https://kobert.dev/spotify-api/token/" + token;
+ }
+ </script>
+</body>
+</html>