refactor: switch auth data from localStorage to sessionStorage

Aligns user and permissions storage with the existing sessionStorage-based
token model. Eliminates the dual-write pattern and stale cross-session data.
This commit is contained in:
2026-07-28 02:16:24 +00:00
parent 739253b2e5
commit c4a10c7129
5 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -21,12 +21,12 @@ const SUBSYSTEMS = [
];
function currentUser() {
const u = JSON.parse(localStorage.getItem('vw:user') || 'null');
const u = JSON.parse(sessionStorage.getItem('vw:user') || 'null');
return u ? u.username : '';
}
function hasAuthAdmin() {
const perms = JSON.parse(localStorage.getItem('vw:permissions') || 'null');
const perms = JSON.parse(sessionStorage.getItem('vw:permissions') || 'null');
return perms && perms.auth === 'rw';
}