Skip to content

Commit

Permalink
fixed #84
Browse files Browse the repository at this point in the history
  • Loading branch information
maggiolo00 authored and maggiolo00 committed Jul 17, 2014
1 parent 82fd533 commit 597e0dd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/scripts/services/database-services.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ database.factory('DatabaseApi', function ($http, $resource) {
resource.createDatabase = function (name, type, stype, username, password, callback) {
$http.defaults.headers.common['Authorization'] = 'Basic ' + Base64.encode(username + ':' + password);
$http.post(API + 'database/' + name + "/" + stype + "/" + type).success(function (data) {
$http.defaults.headers.common['Authorization'] = null;
delete $http.defaults.headers.common['Authorization'];
callback(data);
});
}
Expand All @@ -487,10 +487,11 @@ database.factory('DatabaseApi', function ($http, $resource) {
}
resource.disconnect = function (callback) {
$http.get(API + 'disconnect').success(function () {
$http.defaults.headers.common['Authorization'] = null;

delete $http.defaults.headers.common['Authorization'];
callback();
}).error(function () {
$http.defaults.headers.common['Authorization'] = null;
delete $http.defaults.headers.common['Authorization'];
callback();
});
}
Expand Down

0 comments on commit 597e0dd

Please sign in to comment.