feat: fix the issue of jumping back to the login page after resetting password (#1288)

* fix: redirect to login page

* fix: front end router

* fix: front end router

* fix: signup page router

* fix: redirect to login page
This commit is contained in:
Chell
2022-11-13 05:16:49 +01:00
committed by GitHub
parent d542208eb8
commit 61c2fd5412
5 changed files with 17 additions and 14 deletions

View File

@ -23,6 +23,7 @@ import {CountDownInput} from "../common/CountDownInput";
import * as UserBackend from "../backend/UserBackend";
import {CheckCircleOutlined, KeyOutlined, LockOutlined, SolutionOutlined, UserOutlined} from "@ant-design/icons";
import CustomGithubCorner from "../CustomGithubCorner";
import {withRouter} from "react-router-dom";
const {Step} = Steps;
const {Option} = Select;
@ -166,7 +167,7 @@ class ForgetPage extends React.Component {
values.userOwner = this.state.application?.organizationObj.name;
UserBackend.setPassword(values.userOwner, values.username, "", values?.newPassword).then(res => {
if (res.status === "ok") {
Setting.redirectToLoginPage(this.state.application);
Setting.redirectToLoginPage(this.state.application, this.props.history);
} else {
Setting.showMessage("error", i18next.t(`signup:${res.msg}`));
}
@ -550,4 +551,4 @@ class ForgetPage extends React.Component {
}
}
export default ForgetPage;
export default withRouter(ForgetPage);