spotifytobandcamp/static/gethash.js
2021-09-09 02:06:39 +02:00

15 lines
329 B
JavaScript

const hash = window.location.hash.substring(1).split('&');
var datas = {};
for (let elem of hash) {
elem = elem.split('=');
datas[elem[0]] = elem[1];
}
fetch('/mytoken', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(datas)
}).then(() => {window.location.replace("/")});