Browse Source

dashboard: Fix historical version compatibility problem for auth check via localStorage (#1473)

master
cdfive GitHub 4 years ago
parent
commit
46076b34aa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions
  1. +9
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/header/header.js
  2. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/dist/js/app.js
  3. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/dist/js/app.vendor.js

+ 9
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/directives/header/header.js View File

@@ -27,7 +27,15 @@ angular.module('sentinelDashboardApp')
}
});
} else {
handleLogout($scope, JSON.parse($window.localStorage.getItem("session_sentinel_admin")).id)
try {
var id = JSON.parse($window.localStorage.getItem("session_sentinel_admin")).id;
handleLogout($scope, id);
} catch (e) {
// Historical version compatibility processing, fixes issue-1449
// If error happens while parsing, remove item in localStorage and redirect to login page.
$window.localStorage.removeItem("session_sentinel_admin");
$state.go('login');
}
}

function handleLogout($scope, id) {


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/dist/js/app.js
File diff suppressed because it is too large
View File


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/dist/js/app.vendor.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save