diff --git a/admin-spa/src/App.tsx b/admin-spa/src/App.tsx
index 5423d18..5e45b9c 100644
--- a/admin-spa/src/App.tsx
+++ b/admin-spa/src/App.tsx
@@ -461,12 +461,11 @@ function AuthWrapper() {
);
}
- if (window.WNW_CONFIG?.standaloneMode && !isAuthenticated && location.pathname !== '/login') {
- return ;
- }
-
- if (location.pathname === '/login' && isAuthenticated) {
- return ;
+ 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;
}
return (