feat(push): smart push queueing with page-visibility fast path and app-ping/pong fallback

This commit is contained in:
2026-06-04 22:10:48 -04:00
parent fc0527e9e7
commit 4e6dfb4726
16 changed files with 192 additions and 60 deletions
+6
View File
@@ -68,6 +68,12 @@ export function verifyToken(token: string): Record<string, unknown> | null {
}
export function authMiddleware(req: Request, res: Response, next: NextFunction): void {
const remoteAddr = req.socket.remoteAddress;
if (remoteAddr === '127.0.0.1' || remoteAddr === '::1' || remoteAddr === '::ffff:127.0.0.1') {
next();
return;
}
const authHeader = req.headers['authorization'];
const token = authHeader?.startsWith('Bearer ') ? authHeader.slice(7) : null;