title: How to run development http server on localhost authenticating with Google OAuth 2 after App is in production?
body: <p>I have developed a javascript web application that uses OAuth 2 in order to authenticate Google users. While the app was in test stage, I could login users both in my local http-server development environment (localhost) and in the production environment (web server with proper domain name).</p>
  <p>However, since I have upgraded my web application to production, I cannot login at localhost anymore. The code below used to work, but now auth2.isSignedIn is always false when running in localhost, even after a successful login.</p>
  <pre><code>  const signinChanged = function (val) {
      // do something with the credentials of the logged in user
    } 
  
    auth2 = gapi.auth2.init({
      client_id: 'CLIENT_ID.apps.googleusercontent.com'
    }).then( function () {
      auth2 = gapi.auth2.getAuthInstance()
      auth2.isSignedIn.listen(signinChanged);
    });
  })
  
  </code></pre>
  <p>What is the proper way to deal with development vs. production environments when you are using OAuth2?</p>