fix: BB admin login no longer bounces to distribute

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>
This commit is contained in:
Ryan Salazar
2026-05-26 14:28:29 +00:00
parent 0e733ca0f8
commit 17e8d9914e
41 changed files with 163 additions and 48 deletions

View File

@@ -289,7 +289,7 @@ export default function NotificationsPage() {
// Auth guard
useEffect(() => {
if (user === null) router.push('/login');
if (user === null) router.push('/login?next=' + encodeURIComponent(window.location.pathname));
}, [user, router]);
// Build notifications from live DB data