diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json index 05ecb6912219b..73f63186a9c13 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json @@ -92,7 +92,8 @@ "home": "Home", "invalidUrl": "Page Not Found. Please check the URL and try again.", "notFound": "Page Not Found", - "title": "Error" + "title": "Error", + "authenticating": "Authenticating..." }, "expand": { "collapse": "Collapse", diff --git a/airflow-core/src/airflow/ui/src/pages/Error.tsx b/airflow-core/src/airflow/ui/src/pages/Error.tsx index 28fa9ec84af98..fc7e28494b722 100644 --- a/airflow-core/src/airflow/ui/src/pages/Error.tsx +++ b/airflow-core/src/airflow/ui/src/pages/Error.tsx @@ -16,19 +16,40 @@ * specific language governing permissions and limitations * under the License. */ -import { Box, VStack, Heading, Text, Button, Container, HStack, Code } from "@chakra-ui/react"; +import { Box, VStack, Heading, Text, Button, Container, HStack, Code, Spinner } from "@chakra-ui/react"; import { useTranslation } from "react-i18next"; -import { useNavigate, useRouteError, isRouteErrorResponse } from "react-router-dom"; +import { useNavigate, useRouteError, isRouteErrorResponse, useLocation } from "react-router-dom"; import { AirflowPin } from "src/assets/AirflowPin"; export const ErrorPage = () => { const navigate = useNavigate(); const error = useRouteError(); + const location = useLocation(); const { t: translate } = useTranslation(); let errorMessage = translate("error.defaultMessage"); let statusCode = ""; + + // Check if we're in the OAuth flow + const isInAuthFlow = location.pathname.includes('oauth') || + location.pathname.includes('login') || + (error && typeof error === 'object' && 'status' in error && error.status === 401); + + // If we're in the auth flow, don't show the error page + if (isInAuthFlow) { + return ( + + + + + + {translate("error.authenticating")} + + + + ); + } if (error === null || error === undefined) { statusCode = "404";