security: server-owned audit logs + fullscreen custom pages

Port upstream PR #22 + Lite style updates:
- lib/audit.js: server-side logAudit(req, action, userId), records
  IP from x-forwarded-for / cf-connecting-ip
- login/register/create_post/create_reply record server-side
- Remove client logEvent calls (AppProvider/NewPost/ReplyList)
- Remove forgeable POST /api/event-logs endpoint
- CustomPage: fullscreen immersive (fixed, 100vh-nav, mobile 56px
  nav offset) matching upstream Lite
This commit is contained in:
lezi-fun committed 2026-08-12 09:06:50 +08:00
1 parent 45ace3ba75
commit b9d6ca5da8
11 files changed
+73 -24

No files matched your search

+1 -4
View File
@@ -181,8 +181,7 @@ export default function AppProvider({ children, cachedName = '' }) {
try {
const user = await API.getMe();
setCurrentUser(user);
API.logEvent('login').catch(() => {});
} catch {
} catch {
setToken(null);
}
}
@@ -395,7 +394,6 @@ export default function AppProvider({ children, cachedName = '' }) {
const result = await API.login(email, password);
if (result.user) {
setCurrentUser(result.user);
API.logEvent('login').catch(() => {});
}
return result;
}, []);
@@ -405,7 +403,6 @@ export default function AppProvider({ children, cachedName = '' }) {
const loginResult = await API.login(email, password);
if (loginResult.user) {
setCurrentUser(loginResult.user);
API.logEvent('register').catch(() => {});
}
return result;
}, []);