only assign Authorization when session exists

This commit is contained in:
AJ ONeal 2017-02-08 16:47:29 -05:00
parent 8a00e9c0cd
commit 23ea5046bb
1 changed files with 4 additions and 2 deletions

View File

@ -141,8 +141,10 @@
function lintAndRequest(preq) {
function goGetHer() {
preq.headers = preq.headers || {};
preq.headers.Authorization = 'Bearer ' + (preq.session.access_token || preq.session.accessToken);
if (preq.session) {
preq.headers = preq.headers || {};
preq.headers.Authorization = 'Bearer ' + (preq.session.access_token || preq.session.accessToken);
}
if (!oauth3._lintRequest) {
return rawRequest(preq);