Skip to content

Commit

Permalink
Add support for cross site requests with credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
hayssams committed Jan 5, 2016
1 parent 1372231 commit 30736a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions zeppelin-web/src/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
}
};
})
.config(function ($routeProvider, ngToastProvider) {
.config(function ($httpProvider, $routeProvider, ngToastProvider) {
// withCredentials when running locally via grunt
$httpProvider.defaults.withCredentials = true;

$routeProvider
.when('/', {
templateUrl: 'app/home/home.html'
Expand Down Expand Up @@ -80,9 +83,10 @@


function auth() {
var initInjector = angular.injector(['ng']);
var $http = initInjector.get('$http');
var $http = angular.injector(['ng']).get('$http');
var baseUrlSrv = angular.injector(['zeppelinWebApp']).get('baseUrlSrv');
// withCredentials when running locally via grunt
$http.defaults.withCredentials = true;

return $http.get(baseUrlSrv.getRestApiBase()+'/security/ticket').then(function(response) {
zeppelinWebApp.run(function($rootScope) {
Expand Down

0 comments on commit 30736a0

Please sign in to comment.