fix: Use WordPress native login instead of custom login page for nonce consistency

This commit is contained in:
dwindown
2025-11-05 00:34:34 +07:00
parent ea97a95f34
commit 0f6696b361

View File

@@ -461,12 +461,11 @@ function AuthWrapper() {
); );
} }
if (window.WNW_CONFIG?.standaloneMode && !isAuthenticated && location.pathname !== '/login') { if (window.WNW_CONFIG?.standaloneMode && !isAuthenticated) {
return <Navigate to="/login" replace />; // Redirect to WordPress login with return URL
} const returnUrl = encodeURIComponent(window.location.href);
window.location.href = `/wp-login.php?redirect_to=${returnUrl}`;
if (location.pathname === '/login' && isAuthenticated) { return null;
return <Navigate to="/" replace />;
} }
return ( return (