Skip to content

Instantly share code, notes, and snippets.

@rfinni
Created October 20, 2016 02:11
Show Gist options
  • Select an option

  • Save rfinni/698df05808e338c8b833739b4948373a to your computer and use it in GitHub Desktop.

Select an option

Save rfinni/698df05808e338c8b833739b4948373a to your computer and use it in GitHub Desktop.
checkAuth() {
const redirect = '&redirect_uri=https://localhost:3000';
if(window.location.hash) {
const access_token = window.location.hash.substring(1);
if(!window.localStorage.access_token) {
window.localStorage.setItem('access_token', access_token);
}
this.setState({
access_token: window.localStorage.access_token
});
} else {
window.location = some url with authorization scope level;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment