hussnainahmedd opened a new pull request, #709:
URL: https://github.com/apache/shenyu-dashboard/pull/709
Closes #604
## What
In the unauthorized branch of `AuthRoute.render`, the code returned a
`<Route>` whose `path` was the redirect target with a `null` component. That
route never matches the current location, so nothing rendered and the user was
never sent to the 403 page — just a blank content area.
## Why
`redirectPath` is effectively dead as long as it's only used as a
non-matching route path. The fix returns `<Redirect to={redirectPath} />` from
`dva/router` (the router API this component already uses — same pattern as
`BasicLayout.js` and `UserLayout.js`), so unauthorized URLs actually navigate
to the redirect target (`/exception/403` in `BasicLayout`, `/user/login` in
`router.js`).
## Validation
- ESLint on `src/utils/AuthRoute.js`: 0 errors, 0 warnings.
- Verified `redirectPath` is provided at both `AuthRoute` usage sites and
`Redirect` is exported from `dva/router` (already used elsewhere in the repo).
- Diff is 2 lines: one import, one render branch. No behavior change for
authorized users.
--
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]