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

@@ -21,7 +21,7 @@ export default function EmailDashboard() {
const [stats, setStats] = useState<any>(null);
const [loadingData, setLoadingData] = useState(true);
useEffect(() => { if (!loading && !user) router.push('/login'); }, [user, loading, router]);
useEffect(() => { if (!loading && !user) router.push('/login?next=' + encodeURIComponent(window.location.pathname)); }, [user, loading, router]);
const load = useCallback(async () => {
setLoadingData(true);