ThanoshanMV commented on a change in pull request #1284:
URL: https://github.com/apache/apisix-dashboard/pull/1284#discussion_r556359385
##########
File path: web/src/pages/Setting/Setting.tsx
##########
@@ -62,7 +62,15 @@ const Setting: React.FC = () => {
});
setTimeout(() => {
const redirect = getUrlQuery('redirect');
- window.location.href = redirect ? decodeURIComponent(redirect) : '/';
+ const currentHost = window.location.host;
+ if (redirect) {
+ const redirectUrl = decodeURIComponent(redirect);
+ const redirectHost = redirectUrl.split('/')[2];
+ if (currentHost === redirectHost) {
+ window.location.href = redirectUrl;
Review comment:
I studied the source code and understood that `history.push()` is done
via importing history from umi. I referred the [umi documentation on
`history.push()`](https://umijs.org/api#history).
So, in line 70, can we try to replace the code like below:
`history.push(redirectUrl);`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]