Fixed error with only localhost with spotify inport

This commit is contained in:
Kasper Rynning-Tønnesen
2016-08-31 15:42:02 +02:00
parent c9dc08fe52
commit f67340dc84
2 changed files with 2 additions and 2 deletions

View File

@@ -1 +1 @@
!function(){function o(o){var t,e=o.substring(1).split("&"),a={};for(var i in e)t=e[i].split("="),2==t.length&&(a[t[0]]=t[1]);return a}window.addEventListener("load",function(){console.log("hello");var t="b934ecdd173648f5bcd38738af529d58",e="http://localhost/spotify_callback",a="token",i="playlist-read-private playlist-read-collaborative user-read-private";if(window.location.hash.length<=0)window.location.href="https://accounts.spotify.com/authorize?client_id="+t+"&scope="+i+"&show_dialog=false&response_type="+a+"&redirect_uri="+e;else{var l=o(window.location.hash);window.opener.callback(l)}})}(); !function(){function e(e){var t,o=e.substring(1).split("&"),n={};for(var a in o)t=o[a].split("="),2==t.length&&(n[t[0]]=t[1]);return n}window.addEventListener("load",function(){console.log("hello");var t="b934ecdd173648f5bcd38738af529d58",o=window.location.protocol+"//"+window.location.hostname+"/spotify_callback",n="token",a="playlist-read-private playlist-read-collaborative user-read-private";if(window.location.hash.length<=0)window.location.href="https://accounts.spotify.com/authorize?client_id="+t+"&scope="+a+"&show_dialog=false&response_type="+n+"&redirect_uri="+o;else{var i=e(window.location.hash);window.opener.callback(i)}})}();

View File

@@ -1,7 +1,7 @@
window.addEventListener("load", function(){ window.addEventListener("load", function(){
console.log("hello"); console.log("hello");
var client_id = "b934ecdd173648f5bcd38738af529d58"; var client_id = "b934ecdd173648f5bcd38738af529d58";
var redirect = "http://localhost/spotify_callback"; var redirect = window.location.protocol + "//" + window.location.hostname + "/spotify_callback";
var response = "token"; var response = "token";
var scope = "playlist-read-private playlist-read-collaborative user-read-private"; var scope = "playlist-read-private playlist-read-collaborative user-read-private";
if(window.location.hash.length <= 0){ if(window.location.hash.length <= 0){