Skip to content

Instantly share code, notes, and snippets.

@wgao19
Created November 7, 2019 06:18
Show Gist options
  • Save wgao19/8ff779ec011919ca8fff00d162bd10f1 to your computer and use it in GitHub Desktop.
Save wgao19/8ff779ec011919ca8fff00d162bd10f1 to your computer and use it in GitHub Desktop.
async function loadAuthInstance() {
const load = new Promise(function(resolve, reject) {
gapi.load('auth2', resolve);
});
return load.then(async () => {
return await window.gapi.auth2
.init({
client_id: 'client-id-apparently',
})
.then(authInstance => {
window.authInstance = authInstance;
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment