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

   For some reason I did not discover it yesterday - but now I am experiencing 
problems with the login button `next` query-param for the redirect after 
successful authentication. It renders the following:
   
   ```
   
href="/superset/login/MyIdP?next=%2Fsuperset%2Fsuperset%2Fsuperset%2Fwelcome%2F"
   ```
   
   but correct would be (I have `SUPERSET_APP_ROOT=/superset`)
   
   ```
   href="/superset/login/MyIdP?next=%2Fsuperset%2Fsuperset%2Fwelcome%2F"
   ```
   
   Thus, after successful authentication, I get a 404.
   
   If I see this correctly, the problem is, that you wrap the `next`-URL with 
`ensureAppRoot` although the URL is retrieved  already with the correct app 
root attached:
   
   ```
     const nextUrl = useMemo(() => {
       try {
         const params = new URLSearchParams(window.location.search);
         const next = params.get('next') || '';
         return next ? ensureAppRoot(next) : '';
       } catch (_error) {
         return '';
       }
     }, []);
     ```
   
   I think the correct approach would be to just use the URL as retrieved from 
the URL search params as it is already "ensured app root".
   
   What do you think, @albundy83?


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