Skip to content

Instantly share code, notes, and snippets.

@krusty
Created July 30, 2012 17:55
Show Gist options
  • Save krusty/3208697 to your computer and use it in GitHub Desktop.
Save krusty/3208697 to your computer and use it in GitHub Desktop.
if (store.get('access_token')) {
params.beforeSend = function(xhr) {
xhr.setRequestHeader('Authorization', 'OAuth ' + store.get('access_token'));
};
} else {
params.beforeSend = function(xhr) {
xhr.setRequestHeader('Authorization', 'ClientID ' + store.get('ClientID'));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment