From ff613f8e6210d2c4cd2f8deacc0096e18aff2fcd Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 22 Oct 2018 11:50:53 -0400 Subject: #725 move push handlers inside beforeEnter for better consistency --- www/js/WizardCtrl.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index f4b3d456..fb76c64c 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -343,6 +343,20 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function logout(u) { var d = $q.defer(); + if (window.cordova) { + // we need to do this or ZM will send same auth hash + // this was fixed in a PR dated Oct 18 + NVRDataModel.debug ("Clearing cookies"); + cordova.plugin.http.clearCookies(); + + if ($scope.wizard.useauth && $scope.wizard.usebasicauth) { + NVRDataModel.debug ("setting basic auth"); + cordova.plugin.http.useBasicAuth($scope.wizard.basicuser, $scope.wizard.basicpassword); + + } + } + + $http({ method: 'POST', url: u, -- cgit v1.2.3 From 00c98cae610c0985c69b3b7bdb078cfbd354df0a Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 22 Oct 2018 14:56:10 -0400 Subject: clear cookies in desktop too --- www/js/WizardCtrl.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index fb76c64c..0852f4f6 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -2,7 +2,7 @@ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console, Masonry, URI */ -angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$ionicPopup', 'SecuredPopups', '$http', '$q', 'zm', '$ionicLoading', 'WizardHandler', '$translate', function ($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $ionicPopup, SecuredPopups, $http, $q, zm, $ionicLoading, WizardHandler, $translate) { +angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$ionicPopup', 'SecuredPopups', '$http', '$q', 'zm', '$ionicLoading', 'WizardHandler', '$translate', '$cookies', function ($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $ionicPopup, SecuredPopups, $http, $q, zm, $ionicLoading, WizardHandler, $translate, $cookies) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -342,19 +342,25 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function logout(u) { var d = $q.defer(); - + NVRDataModel.debug ("Clearing cookies"); if (window.cordova) { // we need to do this or ZM will send same auth hash // this was fixed in a PR dated Oct 18 - NVRDataModel.debug ("Clearing cookies"); - cordova.plugin.http.clearCookies(); + + cordova.plugin.http.clearCookies(); + } + else { + angular.forEach($cookies, function (v, k) { + $cookies.remove(k); + }); + } if ($scope.wizard.useauth && $scope.wizard.usebasicauth) { NVRDataModel.debug ("setting basic auth"); cordova.plugin.http.useBasicAuth($scope.wizard.basicuser, $scope.wizard.basicpassword); } - } + $http({ -- cgit v1.2.3 From 58039e034a7078868839c74a6c7e1970d670dd5b Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Wed, 7 Nov 2018 11:46:04 -0500 Subject: nits --- www/js/WizardCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/WizardCtrl.js') diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index 0852f4f6..8a5f1ac4 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -356,7 +356,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ } if ($scope.wizard.useauth && $scope.wizard.usebasicauth) { - NVRDataModel.debug ("setting basic auth"); + NVRDataModel.debug ("setting basic auth with "+$scope.wizard.basicuser+":"+$scope.wizard.basicpassword); cordova.plugin.http.useBasicAuth($scope.wizard.basicuser, $scope.wizard.basicpassword); } -- cgit v1.2.3