Created
July 26, 2018 03:32
-
-
Save wongyouth/45f7a56a7ae86e5e546dad5af2523fc2 to your computer and use it in GitHub Desktop.
getQueryParams
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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