X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Faccounts%2Fapi%2Faccounts.js;h=cf0e4048daae5d8612f5d8f4991e78d4692de0f4;hb=3d39b18290b9cb3e10c1a80d91ac4819e7c58474;hp=ec74f51e75cd4b135a8259e84d3883eef9a7f200;hpb=05b0bf7615e179d26d14d5d40f021fa3db9142a6;p=osm%2FUI.git diff --git a/skyquake/plugins/accounts/api/accounts.js b/skyquake/plugins/accounts/api/accounts.js index ec74f51e7..cf0e4048d 100644 --- a/skyquake/plugins/accounts/api/accounts.js +++ b/skyquake/plugins/accounts/api/accounts.js @@ -93,7 +93,7 @@ function getAccount(req) { _.extend( requestHeaders, id ? constants.HTTP_HEADERS.accept.data : constants.HTTP_HEADERS.accept.collection, { - 'Authorization': req.get('Authorization') + 'Authorization': req.session && req.session.authorization } ); @@ -160,7 +160,7 @@ function updateAccount(req) { _.extend(requestHeaders, constants.HTTP_HEADERS.accept.data, constants.HTTP_HEADERS.content_type.data, { - 'Authorization': req.get('Authorization') + 'Authorization': req.session && req.session.authorization }); request({ url: url, @@ -194,7 +194,7 @@ function deleteAccount(req) { _.extend(requestHeaders, constants.HTTP_HEADERS.accept.data, constants.HTTP_HEADERS.content_type.data, { - 'Authorization': req.get('Authorization') + 'Authorization': req.session && req.session.authorization }); request({ url: url, @@ -238,7 +238,7 @@ function refreshAccountConnectionStatus (req) { var headers = _.extend({}, constants.HTTP_HEADERS.accept.data, constants.HTTP_HEADERS.content_type.data, { - 'Authorization': req.get('Authorization') + 'Authorization': req.session && req.session.authorization } ); return new Promise(function(resolve, reject) {