mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 05:10:19 +08:00
Support "signinUrl" in forget page
This commit is contained in:
@ -1253,7 +1253,11 @@ export function renderForgetLink(application, text) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return renderLink(url, text, null);
|
const storeSigninUrl = () => {
|
||||||
|
sessionStorage.setItem("signinUrl", window.location.href);
|
||||||
|
};
|
||||||
|
|
||||||
|
return renderLink(url, text, storeSigninUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderHelmet(application) {
|
export function renderHelmet(application) {
|
||||||
|
@ -47,6 +47,7 @@ class ForgetPage extends React.Component {
|
|||||||
|
|
||||||
this.form = React.createRef();
|
this.form = React.createRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (this.getApplicationObj() === undefined) {
|
if (this.getApplicationObj() === undefined) {
|
||||||
if (this.state.applicationName !== undefined) {
|
if (this.state.applicationName !== undefined) {
|
||||||
@ -153,7 +154,12 @@ class ForgetPage extends React.Component {
|
|||||||
values.userOwner = this.getApplicationObj()?.organizationObj.name;
|
values.userOwner = this.getApplicationObj()?.organizationObj.name;
|
||||||
UserBackend.setPassword(values.userOwner, values.username, "", values?.newPassword, this.state.code).then(res => {
|
UserBackend.setPassword(values.userOwner, values.username, "", values?.newPassword, this.state.code).then(res => {
|
||||||
if (res.status === "ok") {
|
if (res.status === "ok") {
|
||||||
|
const linkInStorage = sessionStorage.getItem("signinUrl");
|
||||||
|
if (linkInStorage !== null && linkInStorage !== "") {
|
||||||
|
Setting.goToLink(linkInStorage);
|
||||||
|
} else {
|
||||||
Setting.redirectToLoginPage(this.getApplicationObj(), this.props.history);
|
Setting.redirectToLoginPage(this.getApplicationObj(), this.props.history);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Setting.showMessage("error", res.msg);
|
Setting.showMessage("error", res.msg);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user