Profile pictures from Gravatar or the identity provider, fetched and kept by the server
Both sources are off until switched on under Settings, Sign-in. The server asks only gravatar.com (by a hash of the email) and the identity provider's own host, accepts only small PNG/JPEG/WebP/GIF, keeps each picture for a day and serves it from /api/avatars/<id>, so browsers never contact either. Shown in the user menu and on the Users page, with initials as the fallback; the Privacy page says when it is on. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9782bd3252
commit
c05c847d17
26 files changed
+4361
-21
No files matched your search
@@ -6,6 +6,8 @@ import { users } from "../db/schema.js";
|
||||
import { requireAuth } from "../auth/middleware.js";
|
||||
import { asyncHandler } from "../utils/asyncHandler.js";
|
||||
import { FIRST_LOOKBACK_MS, getChangesSince } from "../services/changesSince.js";
|
||||
import { avatarUrlFor } from "../services/avatars.js";
|
||||
import { getSettings } from "../services/settingsStore.js";
|
||||
|
||||
export const meRouter = Router();
|
||||
|
||||
@@ -36,10 +38,12 @@ export function parseDashboardLayout(stored: string | null): DashboardLayout {
|
||||
}
|
||||
}
|
||||
|
||||
meRouter.get("/", requireAuth, (req, res) => {
|
||||
const { id, email, name, role, oidcSub, favorites, dashboardLayout } = req.currentUser!;
|
||||
res.json({ user: { id, sub: oidcSub, email, name, role, favorites: parseFavorites(favorites), dashboard: parseDashboardLayout(dashboardLayout) } });
|
||||
});
|
||||
meRouter.get("/", requireAuth, asyncHandler(async (req, res) => {
|
||||
const me = req.currentUser!;
|
||||
const { id, email, name, role, oidcSub, favorites, dashboardLayout } = me;
|
||||
const avatarUrl = avatarUrlFor(me, (await getSettings()).profilePictures);
|
||||
res.json({ user: { id, sub: oidcSub, email, name, role, avatarUrl, favorites: parseFavorites(favorites), dashboard: parseDashboardLayout(dashboardLayout) } });
|
||||
}));
|
||||
|
||||
// Paths inside the app only: a slash, then letters, digits, dashes, underscores and further slashes — and, for a saved view of a page,
|
||||
// a short query of the characters a browser leaves as they are or percent-encodes (the search words, a status, a sort). Which of them
|
||||
|
||||
Reference in new issue
Block a user