From 2d9c7ac1f76a6c34322734f15b890cfbec451a63 Mon Sep 17 00:00:00 2001 From: jperez Date: Tue, 1 Jul 2014 09:48:10 +0200 Subject: [PATCH] Moved rendering of OAuth info inside the condition for access token --- authorization_code/public/index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/authorization_code/public/index.html b/authorization_code/public/index.html index 608e6c7..7b65c5a 100644 --- a/authorization_code/public/index.html +++ b/authorization_code/public/index.html @@ -95,12 +95,13 @@ if (error) { alert('There was an error during the authentication'); } else { - oauthPlaceholder.innerHTML = oauthTemplate({ - access_token: access_token, - refresh_token: refresh_token - }); - if (access_token) { + // render oauth info + oauthPlaceholder.innerHTML = oauthTemplate({ + access_token: access_token, + refresh_token: refresh_token + }); + $.ajax({ url: 'https://api.spotify.com/v1/me', headers: { @@ -114,6 +115,7 @@ } }); } else { + // render initial screen $('#login').show(); $('#loggedin').hide(); }