diff --git a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js index fc930cb5e5..123532f82f 100644 --- a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js +++ b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js @@ -17,9 +17,8 @@ import PasswordInput from "@appserver/components/password-input"; import toastr from "@appserver/components/toast/toastr"; import Loader from "@appserver/components/loader"; import PageLayout from "@appserver/common/components/PageLayout"; -import constants from "@appserver/common/constants"; +import { EmployeeActivationStatus } from "@appserver/common/constants"; import { createPasswordHash } from "@appserver/common/utils"; -const { EmployeeActivationStatus } = constants; const inputWidth = "400px"; @@ -65,7 +64,6 @@ class Confirm extends React.PureComponent { super(props); this.state = { - isConfirmLoaded: false, email: props.linkData.email, firstName: props.linkData.firstname, firstNameValid: true, @@ -192,16 +190,10 @@ class Confirm extends React.PureComponent { const { getSettings, getPortalPasswordSettings, history } = this.props; const requests = [getSettings(), getPortalPasswordSettings(this.state.key)]; - axios - .all(requests) - .then(() => { - this.setState({ isConfirmLoaded: true }); - console.log("get settings success"); - }) - .catch((e) => { - console.error("get settings error", e); - history.push(`/login/error=${e}`); - }); + axios.all(requests).catch((e) => { + console.error("get settings error", e); + history.push(`/login/error=${e}`); + }); window.addEventListener("keydown", this.onKeyPress); window.addEventListener("keyup", this.onKeyPress); @@ -235,8 +227,8 @@ class Confirm extends React.PureComponent { render() { console.log("ActivateUser render"); - const { settings, isConfirmLoaded, t, greetingTitle } = this.props; - return !isConfirmLoaded ? ( + const { settings, t, greetingTitle } = this.props; + return !settings ? ( ) : ( @@ -364,8 +356,6 @@ class Confirm extends React.PureComponent { } Confirm.propTypes = { - getConfirmationInfo: PropTypes.func.isRequired, - activateConfirmUser: PropTypes.func.isRequired, location: PropTypes.object.isRequired, history: PropTypes.object.isRequired, }; diff --git a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeEmail.js b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeEmail.js index 95555c0d49..48710e69e3 100644 --- a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeEmail.js +++ b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeEmail.js @@ -14,13 +14,11 @@ class ChangeEmail extends React.PureComponent { changeEmail(userId, email, key) .then((res) => { console.log("change client email success", res); - tryRedirectTo( - `${window.location.origin}/products/people/view/@self?email_change=success` - ); + tryRedirectTo(`/products/people/view/@self?email_change=success`); }) .catch((e) => { console.log("change client email error", e); - tryRedirectTo(`${window.location.origin}/error=${e}`); + tryRedirectTo(`/error=${e}`); }); } } @@ -32,13 +30,9 @@ class ChangeEmail extends React.PureComponent { changeEmail(userId, email, key) .then((res) => { console.log("change client email success", res); - tryRedirectTo( - `${window.location.origin}/products/people/view/@self?email_change=success` - ); + tryRedirectTo(`/products/people/view/@self?email_change=success`); }) - .catch((e) => { - console.log("change client email error", e); - }); + .catch((e) => console.log("change client email error", e)); } else { tryRedirectTo(defaultPage); }