fix(app): harden account and workflow state
This commit is contained in:
@@ -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() : "";
|
||||
|
||||
Reference in New Issue
Block a user