fix: Use wp_authenticate + wp_set_auth_cookie + wp_set_current_user for proper session
This commit is contained in:
@@ -461,11 +461,12 @@ function AuthWrapper() {
|
||||
);
|
||||
}
|
||||
|
||||
if (window.WNW_CONFIG?.standaloneMode && !isAuthenticated) {
|
||||
// Redirect to WordPress login with return URL
|
||||
const returnUrl = encodeURIComponent(window.location.href);
|
||||
window.location.href = `/wp-login.php?redirect_to=${returnUrl}`;
|
||||
return null;
|
||||
if (window.WNW_CONFIG?.standaloneMode && !isAuthenticated && location.pathname !== '/login') {
|
||||
return <Navigate to="/login" replace />;
|
||||
}
|
||||
|
||||
if (location.pathname === '/login' && isAuthenticated) {
|
||||
return <Navigate to="/" replace />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user