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

@ -22,6 +22,7 @@ import i18next from "i18next";
import AffiliationSelect from "../common/AffiliationSelect";
import OAuthWidget from "../common/OAuthWidget";
import SelectRegionBox from "../SelectRegionBox";
import {withRouter} from "react-router-dom";
class PromptPage extends React.Component {
constructor(props) {
@ -190,7 +191,7 @@ class PromptPage extends React.Component {
if (redirectUrl !== "" && redirectUrl !== null) {
Setting.goToLink(redirectUrl);
} else {
Setting.redirectToLoginPage(this.getApplicationObj());
Setting.redirectToLoginPage(this.getApplicationObj(), this.props.history);
}
} else {
Setting.showMessage("error", `Failed to log out: ${res.msg}`);
@ -234,7 +235,7 @@ class PromptPage extends React.Component {
title="Sign Up Error"
subTitle={"You are unexpected to see this prompt page"}
extra={[
<Button type="primary" key="signin" onClick={() => Setting.redirectToLoginPage(application)}>
<Button type="primary" key="signin" onClick={() => Setting.redirectToLoginPage(application, this.props.history)}>
{
i18next.t("login:Sign In")
}
@ -272,4 +273,4 @@ class PromptPage extends React.Component {
}
}
export default PromptPage;
export default withRouter(PromptPage);