refactoring-backend #4
@@ -56,7 +56,7 @@ import React, {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import * as authApi from "../api/auth";
|
import * as authApi from "../api/auth";
|
||||||
import { setUnauthorizedHandler, resetLogoutState, clearSessionCorrelationId } from "../api/client";
|
import { ApiError, setUnauthorizedHandler, resetLogoutState, clearSessionCorrelationId } from "../api/client";
|
||||||
import { setAuthErrorHandler, resetLogoutState as resetFetchErrorLogoutState } from "../utils/fetchError";
|
import { setAuthErrorHandler, resetLogoutState as resetFetchErrorLogoutState } from "../utils/fetchError";
|
||||||
import { STORAGE_KEY_AUTHENTICATED } from "../utils/constants";
|
import { STORAGE_KEY_AUTHENTICATED } from "../utils/constants";
|
||||||
import { SessionValidationLoading } from "../components/SessionValidationLoading";
|
import { SessionValidationLoading } from "../components/SessionValidationLoading";
|
||||||
@@ -133,6 +133,11 @@ export function AuthProvider({
|
|||||||
|
|
||||||
const handleValidationError = useCallback(
|
const handleValidationError = useCallback(
|
||||||
(error: Error): void => {
|
(error: Error): void => {
|
||||||
|
// Suppress noisy warning for 5xx gateway errors (e.g. 502 Bad Gateway)
|
||||||
|
// during startup — these are server-side issues, not network issues.
|
||||||
|
if (error instanceof ApiError && error.status >= 500) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Network error — log but don't logout.
|
// Network error — log but don't logout.
|
||||||
console.warn("Session validation network error:", error);
|
console.warn("Session validation network error:", error);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user