hannespr commented on PR #38033:
URL: https://github.com/apache/superset/pull/38033#issuecomment-3984956664

   As I am struggling with the same problem, @albundy83, I am thankful, that 
you created a PR. I have tried it out locally - but it did not work for me...
   
   The generated URL of the SSO login button still misses the 
`SUPERSET_APP_ROOT` prefix. Instead, it broke (I have 
`SUPERSET_APP_ROOT=/superset`) `brandLogoHref` which I have set in my custom 
theme. This is now incorrectly also prefixed, so that it is 
`/superset/http://...` :see_no_evil:
   It also broke the logout button, which links now to 
`/superset/superset/logout/`.
   
   But what it also did was fixing the link to the link to Settings -> User -> 
Info and the `brandLogoUrl`, which is now correctly prefixed.
   
   I am not proficient with the Superset code base, but AI suggested me to use 
`ensureAppRoot` from `src/utils/pathUtils` and use it like 
   
   ```
     const loginEndpoint = useMemo(
       () =>
         ensureAppRoot(
           nextUrl
             ? `/login/?next=${encodeURIComponent(nextUrl)}`
             : '/login/',
         ),
       [nextUrl],
     );
   
     const buildProviderLoginUrl = (providerName: string) => {
       const base = ensureAppRoot(`/login/${providerName}`);
       return nextUrl
         ? `${base}${base.includes('?') ? '&' : 
'?'}next=${encodeURIComponent(nextUrl)}`
         : base;
     };
   ```
   
   in `superset-frontend/src/pages/Login/index.tsx`. This actually worked!
   
   What do you and the maintainers think?


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to