chore: remediate pygienium audit findings

Dead code: 77 verified-unused exports, files (BackArrow, MenuBars,
cookies.ts, db/create.ts, schemas/comment.ts, security-headers.ts) and
12 unused dependencies removed
Comments: ~370 RESTATE comments stripped across 53 files; 2 verbose
blocks tightened; dead commented-out config removed
Complexity: bulkUpsert extracted into 11 per-entity helpers (CCN 156->~10);
login formHandler split into 3 submitters (CCN 63->~5); account page render
split into 8 section components (CCN 40); updatePost SQL builder rebuilt;
assert*Owned consolidated behind generic assertOwnedBy
Defensive guards: 4 redundant rethrow/nullish guards removed
This commit is contained in:
2026-08-11 13:36:18 -04:00
parent 33ca9213f2
commit 898c891bd5
76 changed files with 1437 additions and 2600 deletions

View File

@@ -58,7 +58,7 @@ declare global {
}
/** Resolve the client-side active site, preferring the SSR-injected id. */
export function resolveClientSite(): Site {
function resolveClientSite(): Site {
if (typeof window === "undefined") return MAIN_SITE;
const injected = window.__SITE__;
if (injected && SITE_CONFIG[injected]) return SITE_CONFIG[injected];

View File

@@ -53,9 +53,7 @@ export const AuthProvider: ParentComponent = (props) => {
// Get server state using createAsync which works with cache()
const serverAuth = createAsync(() => getUserState(), { deferStream: true });
// Refresh callback that forces re-fetch
const refreshAuth = () => {
// Manually trigger a re-fetch by calling the revalidate function
revalidate(["user-auth-state"]);
};
@@ -70,7 +68,6 @@ export const AuthProvider: ParentComponent = (props) => {
// Server handles all token refresh logic
// Client just displays the current auth state from server
// Listen for auth refresh events from external sources (token refresh, etc.)
onMount(() => {
if (typeof window === "undefined") return;