Add full shell, replaceable Omics adapter and bilingual interaction
Implement approved specification #32 and tickets #33-#37. Keep host authentication server-verified and pin session interaction language. Compile scoped base selectors for browser compatibility and retain full gutters during CSS pruning.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { AuthenticatedUser } from "../../api/types";
|
||||
|
||||
type Principal = Pick<AuthenticatedUser, "issuer" | "subject">;
|
||||
|
||||
function key(user: Principal) {
|
||||
return `thothii:selected-session:${JSON.stringify([window.location.pathname, user.issuer, user.subject])}`;
|
||||
}
|
||||
|
||||
export function readRememberedSession(user: Principal): string | null {
|
||||
try { return sessionStorage.getItem(key(user)); } catch { return null; }
|
||||
}
|
||||
|
||||
export function rememberSession(user: Principal, sessionId: string | null): void {
|
||||
try {
|
||||
if (sessionId) sessionStorage.setItem(key(user), sessionId);
|
||||
else sessionStorage.removeItem(key(user));
|
||||
} catch { /* Reload continuity is optional when browser storage is blocked. */ }
|
||||
}
|
||||
Reference in New Issue
Block a user