From 4e07e5640f96d2be9bf87af8ac5d2679c6a61a5f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 11 Apr 2020 12:03:10 -0400 Subject: #926 clear token if user details change --- www/js/LoginCtrl.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'www/js') diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index ffde6ffa..4a083930 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -726,6 +726,17 @@ function mobilePinConfig () { } //console.log ("SAVING: "+JSON.stringify($scope.loginData)); + + var ld = NVR.getLogin(); + if ((ld.username != $scope.loginData.username) || (ld.password != $scope.loginData.password)) { + NVR.debug ('User information has changed, removing access tokens, if any'); + $scope.loginData.accessToken=''; + $scope.loginData.refreshToken = ''; + $scope.loginData.accessTokenExpires = ''; + $scope.loginData.refreshTokenExpires = ''; + + } + NVR.setLogin($scope.loginData); -- cgit v1.2.3