summaryrefslogtreecommitdiff
path: root/dist/button.html
blob: da99833ae3b3195b4c10444693ccbe4857f55597 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!DOCTYPE html>
<html>
<body>
    <h1>Spotify Intersect</h1>
    <button onclick="click_button()">Connect to Spotify</button>
    <script>
        function click_button() {
            console.log("test");
            //http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
            let token = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
            sessionStorage.setItem('token', token);
            window.location = "https://kobert.dev/spotify-api/token/" + token;
        }
    </script>
</body>
</html>