mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 11:46:28 +00:00
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.
This commit is contained in:
@@ -485,7 +485,8 @@ export const NodeModal: Component<NodeModalProps> = (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<NodeModalProps> = (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({
|
||||
|
||||
Reference in New Issue
Block a user