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:
@@ -101,7 +101,7 @@ export default function AdminNewsletterPage() {
|
||||
const [appliedTemplate, setAppliedTemplate] = useState<NewsletterTemplate | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!loading && !user) router.replace('/account');
|
||||
if (!loading && !user) router.replace('/login?next=' + encodeURIComponent(window.location.pathname));
|
||||
}, [user, loading, router]);
|
||||
|
||||
// Handle ?template= query param (from templates page "Use" button)
|
||||
|
||||
Reference in New Issue
Block a user