0lai0 commented on issue #58032:
URL: https://github.com/apache/airflow/issues/58032#issuecomment-3507792344
Thanks @potiuk for the feedback. I see that PR #57993 correctly fixed the
**backend** redirection logic (in FAB's `get_safe_url`).
However, **Issue #58032** appears to be a separate **frontend** problem in
`Security.tsx` that still persists. The backend fix doesn't address the React
component's behavior.
### The Frontend Issue
The root cause seems to be in `Security.tsx`:
1. The `<iframe>` lacks a `key` prop, which can cause state issues and
frame accumulation when the route changes.
2. There's no navigation coordination. When the iframe navigates (e.g.,
back to `/`), the parent React app's route remains on `/security/:page`. This
mismatch leads to the nested iframe and URL-locking issues.
### Proposed Frontend Fix
To complement the backend fix, I propose modifying `Security.tsx`:
1. Add `key={page}` to the `<iframe />` to force a re-render when the page
prop changes.
2. Use `useEffect` to monitor the iframe's `load` event.
3. Inside the effect, check if the iframe's content location has navigated
back to `/`.
4. If it has, use `useNavigate` to sync the parent app's route (e.g.,
navigate to `/home`).
Does this approach sound correct? I'm still working on finding a consistent
way to reproduce it, but if this logic is sound, I can prepare a PR. Thank you.
--
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]