updating auth token security

This commit is contained in:
2026-01-06 23:11:19 -05:00
parent 4dd3a44711
commit 08a9ad35af
10 changed files with 1373 additions and 140 deletions

View File

@@ -15,7 +15,8 @@ import {
useNavigate,
useLocation,
query,
createAsync
createAsync,
revalidate
} from "@solidjs/router";
import { BREAKPOINTS } from "~/config";
import { getRequestEvent } from "solid-js/web";
@@ -51,6 +52,13 @@ const getUserState = query(async () => {
};
}, "bars-user-state");
/**
* Call this function after login/logout to refresh the user state in the sidebar
*/
export function revalidateUserState() {
revalidate(getUserState.key);
}
function formatDomainName(url: string): string {
const domain = url.split("://")[1]?.split(":")[0] ?? url;
const withoutWww = domain.replace(/^www\./i, "");