JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://oauth.io/lib/oauth.js"></script>
<button id="connect">
  connect with google
</button>
<div id="auth">
  <h1>Successful connexion!</h1>
  <p>Your refresh token</p>
  <pre id="refresh-token"></pre>
  <p>Raw response</p>
  <pre id="response"></pre>
</div>

JavaScript

OAuth.initialize('MpnCNnhVAq_zL089ua883AevC1o');

$('#auth').hide();

$('#connect').click(function() {
	OAuth.popup('google', {
  	authorize: {
    	approval_prompt: 'force'
    }
  }).then(function(google) {
  	$('#auth').show();
    $('#connect').hide();

		$('#refresh-token').html(google.refresh_token)
    $('#response').html(JSON.stringify(google, null, 2))
  })
})