fix(app): harden account and workflow state

This commit is contained in:
cesnimda
2026-08-24 20:21:09 +02:00
parent e7cacad7d6
commit dca5daa1a2
32 changed files with 811 additions and 86 deletions
+5
View File
@@ -72,6 +72,11 @@ export function getAuthUserKey(): string {
return safeGet(window.localStorage, AUTH_USER_KEY) ?? "anon";
}
export function getUserScopedStorageKey(baseKey: string, userKey = getAuthUserKey()): string {
const normalizedUser = userKey.trim() || "anon";
return `${baseKey}:${encodeURIComponent(normalizedUser)}`;
}
export function setAuthUserKey(value: string | null | undefined, emit = true) {
const previous = getAuthUserKey();
const next = typeof value === "string" ? value.trim() : "";