From 92d3ca09fdab947910ea1548df679f8f41dea1f6 Mon Sep 17 00:00:00 2001 From: Matthew Schranz Date: Thu, 19 Mar 2015 16:18:00 -0400 Subject: [PATCH] fix(login): Login didn't correctly pass headers. --- app/scripts/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scripts/app.ts b/app/scripts/app.ts index e7f5258b4..4f24fa0fb 100755 --- a/app/scripts/app.ts +++ b/app/scripts/app.ts @@ -55,10 +55,11 @@ function appRun(gettextCatalog: any, Restangular: restangular.IProvider, // TODO more than just 404 //$state.go("404", {}, {inherit: true}); }); + Restangular.setFullRequestInterceptor(function(element, operation, route, url, headers, params, httpConfig) { var userHeaders = {}; - if (UserService.currentUser) { + if (UserService.currentUser || $cookies["X-Auth-Token"]) { userHeaders["X-Auth-Token"] = $cookies["X-Auth-Token"]; userHeaders["X-Auth-Username"] = $cookies["X-Auth-Username"]; }