Copilot commented on code in PR #709:
URL: https://github.com/apache/shenyu-dashboard/pull/709#discussion_r4237927905


##########
src/utils/AuthRoute.js:
##########
@@ -347,7 +347,7 @@ export default class AuthRoute extends Component {
       if (checkMenuAuth(paths, permissions)) {
         return <Route path={path} component={component} />;
       } else {
-        return <Route path={redirectPath} component={null} />;
+        return <Redirect to={redirectPath} />;

Review Comment:
   The redirect branch has no regression coverage: `AuthRoute.test.js` 
currently exercises only helper functions, so the blank-page defect could 
return unnoticed. Add a test using the connected component's `WrappedComponent` 
with denied permissions and assert that `render()` returns a `Redirect` whose 
`to` is the supplied `redirectPath`, as requested by #604.



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