diff --git a/admin-spa/src/routes/Login.tsx b/admin-spa/src/routes/Login.tsx index e44e166..6810a9b 100644 --- a/admin-spa/src/routes/Login.tsx +++ b/admin-spa/src/routes/Login.tsx @@ -32,18 +32,9 @@ export function Login() { const data = await response.json(); if (response.ok && data.success) { - // Update global config - window.WNW_CONFIG.isAuthenticated = true; - window.WNW_CONFIG.currentUser = data.user; - window.WNW_CONFIG.nonce = data.nonce; - - // CRITICAL: Also update WNW_API.nonce for API requests - if (window.WNW_API) { - window.WNW_API.nonce = data.nonce; - } - - // Redirect to dashboard (no reload needed, auth state is updated) - navigate('/dashboard'); + // CRITICAL: Reload page to get fresh cookies and nonce from PHP + // wp_signon sets cookies but we need PHP to render with proper auth state + window.location.href = window.location.origin + window.location.pathname; } else { setError(data.message || __('Invalid username or password')); }