Skip to content

Commit 616802a

Browse files
committed
v16.2
1 parent f156ea1 commit 616802a

3 files changed

Lines changed: 22 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [16.2] - 2025-11-14
6+
7+
### Fixes
8+
9+
- Fix: Setup wizard redirection loop when API_ENDPOINT differs from actual console host name
10+
511
## [16.1] - 2025-11-06
612

713
### Features

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/spf13/viper"
1515
)
1616

17-
const VERSION = "16.1"
17+
const VERSION = "16.2"
1818

1919
type Config struct {
2020
Server ServerConfig

console/src/pages/SetupWizard.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ export default function SetupWizard() {
5555
}
5656
}
5757
fetchStatus()
58-
}, [navigate, message])
58+
// eslint-disable-next-line react-hooks/exhaustive-deps
59+
}, [])
5960

6061
const handleTestConnection = async () => {
6162
try {
@@ -185,8 +186,11 @@ export default function SetupWizard() {
185186
})
186187

187188
// Wait for server to restart
189+
// Use the API endpoint from the form values or the already configured endpoint
190+
const endpointToCheck = values.api_endpoint || apiEndpoint || window.location.origin
191+
188192
try {
189-
await waitForServerRestart()
193+
await waitForServerRestart(endpointToCheck)
190194

191195
// Success - server is back up
192196
message.success({
@@ -216,22 +220,23 @@ export default function SetupWizard() {
216220
* Wait for the server to restart after setup completion
217221
* Polls the health endpoint until server is back online
218222
*/
219-
const waitForServerRestart = async (): Promise<void> => {
223+
const waitForServerRestart = async (configuredEndpoint: string): Promise<void> => {
220224
const maxAttempts = 60 // 60 seconds max wait
221225
const delayMs = 1000 // Check every second
222226

227+
// Determine the API endpoint URL - use same logic as api client
228+
let apiEndpointUrl = configuredEndpoint
229+
223230
// Wait for server to start shutting down
224231
await new Promise((resolve) => setTimeout(resolve, 2000))
225232

226-
// Poll health endpoint
233+
// Poll setup status endpoint to check if server has restarted
227234
for (let i = 0; i < maxAttempts; i++) {
228235
try {
229-
const response = await fetch('/api/setup.status', {
230-
method: 'GET',
231-
cache: 'no-cache',
232-
headers: {
233-
'Cache-Control': 'no-cache'
234-
}
236+
// Simple GET request without custom headers to avoid CORS preflight issues
237+
// Add timestamp to prevent caching
238+
const response = await fetch(`${apiEndpointUrl}/api/setup.status?t=${Date.now()}`, {
239+
method: 'GET'
235240
})
236241

237242
if (response.ok) {

0 commit comments

Comments
 (0)