This commit is contained in:
seb
2026-10-28 19:31:41 +01:00
parent 01d6aa0e3f
commit 1881830b0a
13 changed files with 81 additions and 27 deletions

View File

@@ -39,6 +39,14 @@ export function clearCachedUser(authId) {
userCache.delete(authId);
}
export function clearCachedCompanyUsers(companyId) {
for (const [k, v] of userCache) {
if (v.user?.selectedCompanyId === companyId) {
userCache.delete(k);
}
}
}
function respondWithAuthPayload(res, req, status, body) {
if (req.path === '/api/auth/me') {
return respondWithAuthenticatedUser(res, status, body);