refactor, security updates, cv extraction upgrades

This commit is contained in:
2026-04-11 01:34:32 +02:00
parent 806b200ac5
commit 27fd70a2d7
59 changed files with 6817 additions and 1561 deletions
+2 -19
View File
@@ -1,26 +1,9 @@
import { decodeJwtPayload, getAuthToken } from "./auth";
import { getAuthUserKey } from "./auth";
export type ThemeModePref = "system" | "light" | "dark";
export function getUserKeyFromToken(): string {
const token = getAuthToken();
if (!token) return "anon";
const payload = decodeJwtPayload(token) ?? {};
const candidates = [
payload.sub,
payload.nameid,
payload["nameid"],
payload["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"],
payload["http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid"],
];
for (const c of candidates) {
if (typeof c === "string" && c.trim().length > 0) return c.trim();
}
return "anon";
return getAuthUserKey();
}
function k(base: string) {