title: Twitter OAuth asks twice for confirmation
body: <p>I wrote a script that asks Twitter for authorization. If the script runs the first time, it will be redirected to Twitter and then the credentials will be saved to a json file. This works. But the authorization page from twitter will be loaded two times. Perhaps somebody can help me to find the bug. Here is the script:</p>
  
  <p>
  
  <pre><code>require('./vendor/autoload.php');
  
  use TijsVerkoyen\Twitter\Twitter;
  
  $twitter = new Twitter('xyz', 'xyz');
  $response = $twitter-&gt;oAuthRequestToken('http://localhost:8888/tweeted-news/oauth-test.php');
  
  $credentials = json_decode(file_get_contents('credentials.json'), true);
  
  if (!isset($credentials['oauth_token'])) {
      $response = $twitter-&gt;oAuthAuthorize($response['oauth_token']);
      $response = $twitter-&gt;oAuthAccessToken($_GET['oauth_token'], $_GET['oauth_verifier']);
      file_put_contents('credentials.json', json_encode($response));
      var_dump('authorized');
  } else {
      $twitter-&gt;setOAuthToken($credentials['oauth_token']);
      $twitter-&gt;setOAuthTokenSecret($credentials['oauth_token_secret']);
      var_dump('credentials');
  }
  
  var_dump($twitter-&gt;accountSettings());
  </code></pre>
  
  <p>I'm using this library <a href="https://github.com/tijsverkoyen/TwitterOAuth" rel="nofollow">https://github.com/tijsverkoyen/TwitterOAuth</a> with composer. Thanks a lot.</p>