Sfoglia il codice sorgente

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

master
cdfive GitHub 4 anni fa
parent
commit
46076b34aa
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
3 ha cambiato i file con 11 aggiunte e 3 eliminazioni
  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 Vedi 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 soppresso perché troppo grande
Vedi File


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/dist/js/app.vendor.js
File diff soppresso perché troppo grande
Vedi File


Loading…
Annulla
Salva