NOTICKET: Refactor project management API to use auth held in session
authorKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Fri, 24 Mar 2017 05:11:47 +0000 (01:11 -0400)
committerKIRAN KASHALKAR <kiran.kashalkar@riftio.com>
Fri, 24 Mar 2017 05:11:47 +0000 (01:11 -0400)
Signed-off-by: KIRAN KASHALKAR <kiran.kashalkar@riftio.com>
skyquake/framework/core/modules/api/projectManagementAPI.js

index 5ba3659..3238aec 100644 (file)
@@ -188,7 +188,7 @@ ProjectManagement.getPlatform = function(req) {
                 uri: utils.confdPort(api_server) + '/api/operational/rbac-platform-config',
                 method: 'GET',
                 headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
-                    'Authorization': req.get('Authorization')
+                    'Authorization': req.session && req.session.authorization
                 }),
                 forever: constants.FOREVER_ON,
                 rejectUnauthorized: false,
@@ -226,7 +226,7 @@ ProjectManagement.updatePlatform = function(req) {
                 uri: utils.confdPort(api_server) + '/api/config/rbac-platform-config',
                 method: 'PUT',
                 headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
-                    'Authorization': req.get('Authorization')
+                    'Authorization': req.session && req.session.authorization
                 }),
                 forever: constants.FOREVER_ON,
                 json: data,