Skip to content

Commit abcb51a

Browse files
committed
fix(client:auth): restrict Authorization header to same origin
1 parent 3c29832 commit abcb51a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: app/templates/client/components/auth(auth)/interceptor.service(js).js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
(function() {
44

5-
function authInterceptor($rootScope, $q, $cookies<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $injector<% } %>) {
5+
function authInterceptor($rootScope, $q, $cookies<% if (filters.ngroute) { %>, $location<% } if (filters.uirouter) { %>, $injector<% } %>, Util) {
66
<% if (filters.uirouter) { %>var state;
77
<% } %>return {
88
// Add authorization token to headers
99
request: function(config) {
1010
config.headers = config.headers || {};
11-
if ($cookies.get('token')) {
11+
if ($cookies.get('token') && Util.isSameOrigin(config.url)) {
1212
config.headers.Authorization = 'Bearer ' + $cookies.get('token');
1313
}
1414
return config;

0 commit comments

Comments
 (0)