dashboard: Fix historical version compatibility problem for auth check via localStorage (#1473)
This commit is contained in:
parent
2b68a6c062
commit
46076b34aa
|
|
@ -27,7 +27,15 @@ angular.module('sentinelDashboardApp')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} 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) {
|
function handleLogout($scope, id) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue