title: Displaying permissions with spotify-web-api-node
body: <p><br>
  I'm using spotify-web-api-node to authorize a user so I can create and modify a users playlist.<br> The app works as it should. Where by the user can be directed to the spotify accounts page,be authorized, and then be redirected to my app.<br> <strong>But when on the Spotify authorize page it doesn't display the permissions(scope) sought by the application</strong>. I'm guessing it should look like the image displayed <a href="https://developer.spotify.com/web-api/using-scopes/" rel="nofollow">HERE</a> on the Spotify website. Im not too sure if its a case that my code isn't complete or there might be an issue with the Spotify authorize page when using spotify-web-api-node.</p>
  
  <h2>Edit</h2>
  
  <h2>app.js</h2>
  
  <pre><code> var SpotifyWebApi = require('spotify-web-api-node');
   var http = require('http'),
   fs = require('fs'),
   index = fs.readFileSync(__dirname + '/index.html');
  
   // Send index.html to all requests
   var app = http.createServer(function(req, res) {
   res.writeHead(200, {'Content-Type': 'text/html'});
   res.end(index);
   });
  
  var scopes = ['playlist-modify-public', 'playlist-modify-private'],
  redirectUri = 'http://localhost:3000',
  clientId = '',
  clientSecret = '',
  state = 'some-state-of-my-choice';
  
  // Setting credentials can be done in the wrapper's constructor.
  var spotifyApi = new SpotifyWebApi({
  redirectUri : redirectUri,
  clientId : clientId,
  clientSecret : clientSecret
  });
  
  // Create the authorization URL
  var authorizeURL = spotifyApi.createAuthorizeURL(scopes, state);
  console.log(authorizeURL);
  
  
  // Socket.io server listens to our app
  var io = require('socket.io').listen(app);
  io.sockets.on('connection', function (socket){
  io.sockets.emit('url',{value:authorizeURL});
  
  //once code is extracted from client-side get tokens
  socket.on('code', function(data){
    var code = data.x;
  
     // get tokens
    spotifyApi.authorizationCodeGrant(code)
      .then(function(data) {
  
      console.log('The token expires in ' + data['expires_in']);
      console.log('The access token is ' + data['access_token']);
      console.log('The refresh token is ' + data['refresh_token']);
      console.log(code);
      }, function(err) {
          console.log('Something went wrong with getting Auth tokens !', err);
        });
       });
     });app.listen(3000);
  </code></pre>
  
  <h2>html</h2>
  
  <pre><code>&lt;body&gt;
    &lt;a&gt;&lt;button&gt;Authorize&lt;/button&gt;&lt;/a&gt;
    &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src='//localhost:3000/socket.io/socket.io.js'&gt;&lt;/script&gt;
      &lt;script&gt;window.jQuery || document.write('&lt;script src="js/vendor/jquery-1.11.1.min.js"&gt;&lt;\/script&gt;')&lt;/script&gt;
  
     &lt;script&gt;
     function getParameterByName(name) {
      name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
      var regex = new RegExp("[\\?&amp;]" + name + "=([^&amp;#]*)"),
      results = regex.exec(location.search);
      return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
      }
  
        $( document ).ready(function() {
          var socket = io.connect('//localhost:3000');
          var code = getParameterByName('code');
              socket.emit('code', { x: code});
              socket.on('url', function(data) {
               $('a').attr('href',data.value);
              });
        });
      &lt;/script&gt;
  
  &lt;/body&gt;
  </code></pre>