Moved rendering of OAuth info inside the condition for access token
This commit is contained in:
parent
1c48876015
commit
2d9c7ac1f7
1 changed files with 7 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue