Skip to content

Instantly share code, notes, and snippets.

@jackrobertscott
Created December 10, 2019 13:34
Show Gist options
  • Save jackrobertscott/c0c998cfcde7ef989346ac1737749149 to your computer and use it in GitHub Desktop.
Save jackrobertscott/c0c998cfcde7ef989346ac1737749149 to your computer and use it in GitHub Desktop.
import * as queryString from 'query-string';
const urlParams = queryString.parse(window.location.search);
if (urlParams.error) {
console.log(`An error occurred: ${urlParams.error}`);
} else {
console.log(`The code is: ${urlParams.code}`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment