Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 23 additions & 2 deletions airflow-core/src/airflow/ui/src/pages/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Box alignItems="center" display="flex" justifyContent="center" pt={36} px={4}>
<Container maxW="lg">
<VStack gap={8} textAlign="center">
<AirflowPin height="50px" width="50px" />
<Spinner size="xl" color="blue.500" />
<Text>{translate("error.authenticating")}</Text>
</VStack>
</Container>
</Box>
);
}

if (error === null || error === undefined) {
statusCode = "404";
Expand Down
Loading