From d340de970fbc694cc096a5d8606020f039dc3083 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 19 Nov 2013 20:47:58 +0000 Subject: [PATCH] AC-654 Added 'X-Auth-Token' as a header in all requests. This will give the API a way to distinguish requests between UI an API Browser and invoke correct RBAC rules. Without this we run into a collision of sorts when user logs into UI and API Browser at the same time from the same browser. --- awx/ui/static/lib/ansible/RestServices.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/awx/ui/static/lib/ansible/RestServices.js b/awx/ui/static/lib/ansible/RestServices.js index 182ec4b0d8..344cc59426 100644 --- a/awx/ui/static/lib/ansible/RestServices.js +++ b/awx/ui/static/lib/ansible/RestServices.js @@ -62,6 +62,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) { } else if (token) { this.setHeader({ Authorization: 'Token ' + token }); + this.setHeader({ "X-Auth-Token": 'Token ' + token }); return $http({method: 'GET', url: this.url, headers: this.headers, @@ -80,6 +81,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) { } else if (token) { this.setHeader({ Authorization: 'Token ' + token }); + this.setHeader({ "X-Auth-Token": 'Token ' + token }); return $http({ method: 'POST', url: this.url, @@ -98,6 +100,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) { } else if (token) { this.setHeader({ Authorization: 'Token ' + token }); + this.setHeader({ "X-Auth-Token": 'Token ' + token }); return $http({ method: 'PUT', url: this.url, @@ -116,6 +119,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) { } else if (token) { this.setHeader({ Authorization: 'Token ' + token }); + this.setHeader({ "X-Auth-Token": 'Token ' + token }); return $http({ method: 'DELETE', url: this.url, @@ -134,6 +138,7 @@ function($http, $rootScope, $cookieStore, $q, Authorization) { } else if (token) { this.setHeader({ Authorization: 'Token ' + token }); + this.setHeader({ "X-Auth-Token": 'Token ' + token }); return $http({ method: 'OPTIONS', url: this.url,