diff --git a/lib/screens/setup/setup_screen.dart b/lib/screens/setup/setup_screen.dart index 9634a58..2d20490 100644 --- a/lib/screens/setup/setup_screen.dart +++ b/lib/screens/setup/setup_screen.dart @@ -36,16 +36,20 @@ class _SetupScreenState extends ConsumerState { if (url.endsWith('/')) url = url.substring(0, url.length - 1); try { - final dio = Dio(BaseOptions(connectTimeout: const Duration(seconds: 5))); + final dio = Dio(BaseOptions( + connectTimeout: const Duration(seconds: 5), + // Accept any HTTP status — only network-level failures throw. + // A 401 or 200 both mean the server is reachable. + validateStatus: (_) => true, + )); await dio.get('$url/api/auth/status'); - // 401 is fine — server is reachable } on DioException catch (_) { setState(() { _testing = false; _error = 'Could not reach server. Check the URL and try again.'; }); return; - } catch (e) { + } catch (_) { setState(() { _testing = false; _error = 'Could not reach server. Check the URL and try again.';