Update admin theme/layout and refresh README details.
Align the project baseline with the latest admin interface styling and layout structure while documenting setup and usage updates in README.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
const AUTH_HINT_KEY = "compton-auth-hint";
|
||||
const PROTECTED_PATH_PREFIXES = ["/admin", "/profile"] as const;
|
||||
|
||||
export function markAuthSessionHint(): void {
|
||||
sessionStorage.setItem(AUTH_HINT_KEY, "1");
|
||||
}
|
||||
|
||||
export function clearAuthSessionHint(): void {
|
||||
sessionStorage.removeItem(AUTH_HINT_KEY);
|
||||
}
|
||||
|
||||
export function hasAuthSessionHint(): boolean {
|
||||
return sessionStorage.getItem(AUTH_HINT_KEY) === "1";
|
||||
}
|
||||
|
||||
export function isProtectedAppPath(pathname: string): boolean {
|
||||
return PROTECTED_PATH_PREFIXES.some(
|
||||
(prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`)
|
||||
);
|
||||
}
|
||||
|
||||
export function shouldAttemptAuthRefresh(pathname = window.location.pathname): boolean {
|
||||
return hasAuthSessionHint() || isProtectedAppPath(pathname);
|
||||
}
|
||||
Reference in New Issue
Block a user