Skip to content

Instantly share code, notes, and snippets.

@bluejack
Last active June 22, 2022 20:51
Show Gist options
  • Save bluejack/21ffc874ba9c00fea9cc66cab0b6fad1 to your computer and use it in GitHub Desktop.
Save bluejack/21ffc874ba9c00fea9cc66cab0b6fad1 to your computer and use it in GitHub Desktop.
async function on_response(response) {
if (response && response.credential) {
const rawdata = jwt_decode(response.credential);
const user = (({ email, family_name, given_name, picture, name }) => ({ email, family_name, given_name, picture, name}))(rawdata);
window.localStorage.setItem('gothic-id', 'loaded');
}
// leverage user object or move on to next step.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment