jedcunningham commented on code in PR #47041:
URL: https://github.com/apache/airflow/pull/47041#discussion_r1968737141


##########
providers/fab/src/airflow/providers/fab/www/views.py:
##########
@@ -70,7 +70,7 @@ class FabIndexView(IndexView):
     def index(self):
         if g.user is not None and g.user.is_authenticated:
             token = get_auth_manager().get_jwt_token(g.user)
-            return redirect(f"/webapp?token={token}", code=302)
+            return redirect(f"{conf.get('fastapi', 
'base_url')}/?token={token}", code=302)

Review Comment:
   (heads up @vincbeck - this doesn't seem to be tested. not going to worry 
about it in this PR though)



##########
airflow/ui/src/router.tsx:
##########
@@ -168,8 +168,7 @@ export const routerConfig = [
   },
 ];
 
-const locationPath = globalThis.window.location.pathname;
-const indexOf = locationPath.indexOf("webapp/");
-const basename = locationPath.slice(0, indexOf + 7);
+const baseUrl = document.querySelector("base")?.href ?? 
"http://localhost:9091/";;

Review Comment:
   If there is a better way to tackle this, please feel free. cc 
@pierrejeambrun 



##########
airflow/auth/managers/simple/ui/src/login/Login.tsx:
##########
@@ -36,7 +36,7 @@ type ExpandedApiError = {
 export const Login = () => {
     const onSuccess = (data: LoginResponse) => {
         // Redirect to index page with the token
-        globalThis.location.replace(`/webapp/?token=${data.jwt_token}`);
+        globalThis.location.replace(`/?token=${data.jwt_token}`);

Review Comment:
   (@pierrejeambrun not going to worry about it in this PR, but this doesn't 
work with a path in `base_url`. I was able to easily fix the other auth 
managers, but not this one.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to