fix: Add WNW_CONFIG type definitions and fix TypeScript errors
This commit is contained in:
@@ -266,7 +266,7 @@ function Header({ onFullscreen, fullscreen, showToggle = true }: { onFullscreen:
|
||||
|
||||
const handleLogout = async () => {
|
||||
try {
|
||||
await fetch(window.WNW_CONFIG.restUrl + '/auth/logout', {
|
||||
await fetch((window.WNW_CONFIG?.restUrl || '') + '/auth/logout', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
});
|
||||
@@ -465,7 +465,7 @@ function AuthWrapper() {
|
||||
// In standalone mode, trust the initial PHP auth check
|
||||
// PHP uses wp_signon which sets proper WordPress cookies
|
||||
if (window.WNW_CONFIG?.standaloneMode) {
|
||||
setIsAuthenticated(window.WNW_CONFIG.isAuthenticated);
|
||||
setIsAuthenticated(window.WNW_CONFIG.isAuthenticated ?? false);
|
||||
setIsChecking(false);
|
||||
} else {
|
||||
// In wp-admin mode, always authenticated
|
||||
|
||||
Reference in New Issue
Block a user