title: Spotify authorization code (not access token) is expiring - how can I circumvent this?
body: <p>I am developing an app that creates a public Spotify playlist for a user who has given proper authorization to do so.</p>
  <p>I am using Flask and Python requests library to accomplish this, but after I've sent a few consecutive POST requests to get an access token from Spotify (using authorization code obtained from previous logic), it begins to fail. I am referring to Step 4 of Authorization Code Flow from this link: <a href="https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow" rel="nofollow noreferrer">https://developer.spotify.com/web-api/authorization-guide/#authorization_code_flow</a></p>
  <p>I know the authorization code is valid, because it doesn't fail for the first few times I run the request (maybe 5-10 times).</p>
  <p>When I print the response from the POST I get the following:
  {'error_description': 'Authorization code expired', 'error': 'invalid_grant'}</p>
  <p>I assume I am not using the authorization code fast enough to get an access token (after repeatedly failing on code logic before the access token POST request, I guess?) but how am I supposed to reset and refresh the authorization code so I can keep making requests repeatedly? Any info on how long I am disabled and generally good programming practice to avoid this scenario?</p>