Skip to content

Instantly share code, notes, and snippets.

@wongyouth
Created July 26, 2018 03:32
Show Gist options
  • Save wongyouth/45f7a56a7ae86e5e546dad5af2523fc2 to your computer and use it in GitHub Desktop.
Save wongyouth/45f7a56a7ae86e5e546dad5af2523fc2 to your computer and use it in GitHub Desktop.
getQueryParams
// https://github.com/nuxt/example-auth0/blob/master/utils/auth.js
const getQueryParams = () => {
const params = {}
window.location.href.replace(/([^(?|#)=&]+)(=([^&]*))?/g, ($0, $1, $2, $3) => {
params[$1] = $3
})
return params
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment