diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml index 5ed96855c24ac..fa2e13c699898 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml +++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml @@ -10294,6 +10294,12 @@ paths: schema: $ref: '#/components/schemas/HTTPExceptionResponse' description: Temporary Redirect + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/HTTPExceptionResponse' + description: Bad Request '422': description: Validation Error content: diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py index f85bcec3a6123..30e22c51b671d 100644 --- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py +++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/auth.py @@ -36,14 +36,16 @@ @auth_router.get( "/login", - responses=create_openapi_http_exception_doc([status.HTTP_307_TEMPORARY_REDIRECT]), + responses=create_openapi_http_exception_doc( + [status.HTTP_307_TEMPORARY_REDIRECT, status.HTTP_400_BAD_REQUEST] + ), ) def login(request: Request, auth_manager: AuthManagerDep, next: None | str = None) -> RedirectResponse: """Redirect to the login URL depending on the AuthManager configured.""" login_url = auth_manager.get_url_login() if next and not is_safe_url(next, request=request): - raise HTTPException(status_code=400, detail="Invalid or unsafe next URL") + raise HTTPException(status.HTTP_400_BAD_REQUEST, detail="Invalid or unsafe next URL") if next: login_url += f"?{urlencode({'next': next})}" diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts index ec044ac30856d..c5de12f7a2969 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts @@ -4086,6 +4086,7 @@ export class LoginService { }, errors: { 307: 'Temporary Redirect', + 400: 'Bad Request', 422: 'Validation Error' } }); diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts index 4d401bfc1a496..c71cf1c9d86b2 100644 --- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts +++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts @@ -7264,6 +7264,10 @@ export type $OpenApiTs = { * Temporary Redirect */ 307: HTTPExceptionResponse; + /** + * Bad Request + */ + 400: HTTPExceptionResponse; /** * Validation Error */