diff --git a/auth.php b/auth.php index 66db7b5c..63b0b7f1 100755 --- a/auth.php +++ b/auth.php @@ -4,12 +4,7 @@ // Create your application here: https://developer.spotify.com/my-applications define('CLIENT_ID','YOUR_ID_HERE'); define('CLIENT_SECRET','YOUR_SECRET_HERE'); - -// Identify this script's URL -$url = (isset($_SERVER['HTTPS']) ? "https" : "http"); -$url.= '://'.$_SERVER[HTTP_HOST]; -$url.= explode('?',$_SERVER['REQUEST_URI'])[0]; -define('URL',$url); +define('REDIRECT_URI','YOUR_REDIRECT_URI_HERE (to this file)'); // Allow cross-domain requests header("Access-Control-Allow-Origin: *"); @@ -75,7 +70,7 @@ if (isset($_GET['code'])){ } else if (isset($_GET['action']) && $_GET['action'] == 'authorize'){ // Simply redirect to the authorization panel - header('Location: https://accounts.spotify.com/authorize?client_id='.CLIENT_ID.'&redirect_uri='.URL.'&scope='.$_GET['scope'].'&response_type=code&show_dialog=true'); + header('Location: https://accounts.spotify.com/authorize?client_id='.CLIENT_ID.'&redirect_uri='.REDIRECT_URI.'&scope='.$_GET['scope'].'&response_type=code&show_dialog=true'); exit; } @@ -92,7 +87,6 @@ if (isset($_GET['code'])){ * Get a new access token * Creates a request to Spotify, which returns a new access_token, refresh_token and token_expiry object * @param $code = string - * @param $url = redirect url (this script) */ function getToken($code){ @@ -106,7 +100,7 @@ function getToken($code){ 'client_secret' => CLIENT_SECRET, 'grant_type' => 'authorization_code', 'code' => $code, - 'redirect_uri' => URL + 'redirect_uri' => REDIRECT_URI ); curl_setopt($ch, CURLOPT_URL,"https://accounts.spotify.com/api/token"); @@ -169,13 +163,4 @@ function refreshToken($refresh_token){ curl_close ($ch); return $response; -} - - - - - - - - - +} \ No newline at end of file diff --git a/mopidy_iris/ext.conf b/mopidy_iris/ext.conf index 973ad7fd..3ceab42d 100755 --- a/mopidy_iris/ext.conf +++ b/mopidy_iris/ext.conf @@ -2,4 +2,4 @@ enabled = true country = NZ locale = en_NZ -authorization_url = http://iris.barnsley.nz/auth.php \ No newline at end of file +authorization_url = https://jamesbarnsley.co.nz/auth_v2.php \ No newline at end of file diff --git a/src/js/bootstrap.js b/src/js/bootstrap.js index 79a3b84d..8d749e94 100755 --- a/src/js/bootstrap.js +++ b/src/js/bootstrap.js @@ -57,7 +57,7 @@ var initialState = { current_tltrack: false, notifications: [], config: { - authorization_url: 'https://jamesbarnsley.co.nz/auth.php' + authorization_url: 'https://jamesbarnsley.co.nz/auth_v2.php' } } }; diff --git a/src/scss/global/_forms.scss b/src/scss/global/_forms.scss index 5e138b4d..214d067d 100755 --- a/src/scss/global/_forms.scss +++ b/src/scss/global/_forms.scss @@ -133,7 +133,7 @@ input[type="submit"] { &.timing-out { position: relative; - &::before { + &:before { @include animate_timeout(2s); content: ''; position: absolute; @@ -175,19 +175,37 @@ input[type="submit"] { position: absolute; display: block; content: ''; - background: rgba(0,0,0,0.15); + background: $mid_grey; opacity: 1; animation: slideloader 1s infinite; - top: 0; right: 0; bottom: 0; left: 0; + height: 3px; z-index: 1; } + &.primary { + &:after { + background: $turquoise; + } + } + + &.secondary { + &:after { + background: $black; + } + } + + &.destructive { + &:after { + background: $red; + } + } + &.white { &:after { - background: rgba(255,255,255,0.5); + background: $white; } } }