From 8129056eb8f021268b4572cc88d479826311fbd2 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sat, 16 Aug 2025 19:11:13 +0000 Subject: [PATCH] fix: use authenticated requests for setup-script-url endpoint The copy button in NodeModal was using plain fetch() instead of apiFetch() for the /api/setup-script-url endpoint, causing 401 errors when authentication is configured. Updated both PVE and PBS setup script generation to use authenticated requests. --- frontend-modern/src/components/Settings/NodeModal.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend-modern/src/components/Settings/NodeModal.tsx b/frontend-modern/src/components/Settings/NodeModal.tsx index a5f03d075..84f612374 100644 --- a/frontend-modern/src/components/Settings/NodeModal.tsx +++ b/frontend-modern/src/components/Settings/NodeModal.tsx @@ -485,7 +485,8 @@ export const NodeModal: Component = (props) => { } // Always regenerate URL when host changes - const response = await fetch('/api/setup-script-url', { + const { apiFetch } = await import('@/utils/apiClient'); + const response = await apiFetch('/api/setup-script-url', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ @@ -778,7 +779,8 @@ export const NodeModal: Component = (props) => { } // Always regenerate URL when host changes - const response = await fetch('/api/setup-script-url', { + const { apiFetch } = await import('@/utils/apiClient'); + const response = await apiFetch('/api/setup-script-url', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({