This is an automated email from the ASF dual-hosted git repository.
pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 074c822c6a1 Fix 401 and 403 handling new UI (#44342)
074c822c6a1 is described below
commit 074c822c6a1ddbd6f2d8129743a290cf1d0fe607
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Mon Nov 25 21:08:37 2024 +0800
Fix 401 and 403 handling new UI (#44342)
---
airflow/ui/src/main.tsx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/airflow/ui/src/main.tsx b/airflow/ui/src/main.tsx
index 8d6d3bf0a69..524efdb6695 100644
--- a/airflow/ui/src/main.tsx
+++ b/airflow/ui/src/main.tsx
@@ -47,11 +47,13 @@ const queryClient = new QueryClient({
axios.interceptors.response.use(
(response) => response,
(error: AxiosError) => {
- if (error.response?.status === 403 || error.response?.status === 401) {
+ if (error.response?.status === 401) {
const params = new URLSearchParams();
params.set("next", globalThis.location.href);
- globalThis.location.replace(`/login?${params.toString()}`);
+ globalThis.location.replace(
+ `${import.meta.env.VITE_LEGACY_API_URL}/login?${params.toString()}`,
+ );
}
return Promise.reject(error);