title: How to handle authentication with callback uri in react router
body: <p>I created my first react app that use spotify api to display data but i have problem with deploying it to netlify or any server
  Te authentication flow:
   1. User click the button on  my app that redirects him to spotify/auth 
   2. Spotify auth check permissions and prompt login button, when succesful its redirect user to url of my app with /localhost at the end
  3. i use react router and switch component to handle that /callback route and save token and eveything
  On localhost it works just fine but on live-server or netlify there is when error when spotify sends user to /callback </p>
  
  <p>This is my react routes set up</p>
  
  <p>It says "Cannot GET /callback"</p>
  
  <pre><code> &lt;Router&gt;
      &lt;Provider store={store}
          &lt;Switch&gt;
            &lt;Route exact path="/" component={LoginView} /&gt;
            &lt;Route exact path="/callback" component={CallBack} /&gt;
            &lt;PrivateRoute path="/app"&gt;
              &lt;AppView /&gt;
            &lt;/PrivateRoute&gt;
          &lt;/Switch&gt;
      &lt;/Provider&gt;
    &lt;/Router&gt;
  </code></pre>
  
  <p>And this is the function that launches when user click loggin button :</p>
  
  <pre><code>  handleLogin = () =&gt; {
  // redirect user to spotify to authenticate them
  const params = queryString.stringify({
    client_id: "client_id,
    response_type: "token",
    redirect_uri: `${window.location.origin}/callback`,
    scope: "user-top-read playlist-modify-public playlist-modify-private",
  });
  window.location = `https://accounts.spotify.com/authorize?${params}`;
  </code></pre>
  
  <p>I really cant figure out why is it working that way </p>