From 0edc2ecea41adbb5be1896323203c07dbbe26dbe Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Mon, 12 Jun 2017 09:24:57 +1200 Subject: [PATCH] Authorization method --- auth.php | 78 ++++++++---------------------- src/js/services/spotify/actions.js | 2 +- 2 files changed, 22 insertions(+), 58 deletions(-) diff --git a/auth.php b/auth.php index d93c5ecc..4dcd9b9d 100755 --- a/auth.php +++ b/auth.php @@ -1,10 +1,16 @@ - '01d4ca2e9f4f415c80502431a6aa4200', - 'client_secret' => '7352c9c74791478ab02be0f004ec9541', + 'client_id' => CLIENT_ID, + 'client_secret' => CLIENT_SECRET, 'grant_type' => 'authorization_code', 'code' => $code, - 'redirect_uri' => $url + 'redirect_uri' => URL ); curl_setopt($ch, CURLOPT_URL,"https://accounts.spotify.com/api/token"); diff --git a/src/js/services/spotify/actions.js b/src/js/services/spotify/actions.js index 6b887655..ee6cb011 100755 --- a/src/js/services/spotify/actions.js +++ b/src/js/services/spotify/actions.js @@ -111,7 +111,7 @@ function refreshToken( dispatch, getState ){ $.ajax({ method: 'GET', - url: '//jamesbarnsley.co.nz/auth.php?action=refresh&refresh_token='+getState().spotify.refresh_token, + url: getState().config.authorization_url+'?action=refresh&refresh_token='+getState().spotify.refresh_token, dataType: "json", timeout: 10000 })