Problem: /admin/* pages redirect unauthed users to /login or /account,
both of which then hit middleware redirecting to distribute.relevant
mediaproperties.com. Distribute is on a different domain, so its session
cookie doesn't carry to broadcastbeat.com — sign-in there left admins
stranded on distribute's dashboard.
Fix:
- Remove /login (and /register) from middleware REDIRECT_PATHS. wp-login,
wp-admin, client-login still bounce to distribute.
- /login is now a real BB sign-in form (was a redirect to /client-login).
- Admin pages preserve return path via /login?next=<encoded path>.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fires one impression per page render, per slot, server-side — mirrors
AdSanity's WP-level counting model. Picks one banner from each slot's
rotation pool per request. Edge-worker-cached pool refresh, 5min TTL.
Closes the structural gap with historical AdSanity numbers
(client-side counting was dropping 25-40% to ad blockers, plus the
beacon failed silently on fast navigations).
- Header.tsx: remove "SIGN IN" and "REGISTER" buttons from the top
utility bar and the mobile drawer. Auth for PR firms / writers lives
at distribution.relevantmediaproperties.com now; the local /client-login
and /register routes are no longer the right entry point.
- src/middleware.ts (new): 301-redirect /wp-login, /wp-login.php,
/wp-admin, /wp-admin/*, /login, /client-login, and /register to
https://distribution.relevantmediaproperties.com/login so existing
bookmarks and old WP-era links land somewhere useful instead of 404.
- Newsletter signup form, social icons, country selector all retained.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>