From 3123ba79934055b25eba90644c8dccb956c6c302 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 20 Jul 2022 00:49:11 +0300 Subject: [PATCH] Web: People: fix redirect --- .../dialogs/ResetApplicationDialog/index.js | 15 ++++++++------- .../src/pages/Profile/Section/Body/index.js | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/products/ASC.People/Client/src/components/dialogs/ResetApplicationDialog/index.js b/products/ASC.People/Client/src/components/dialogs/ResetApplicationDialog/index.js index e48b0e5478..4ed7b0c49e 100644 --- a/products/ASC.People/Client/src/components/dialogs/ResetApplicationDialog/index.js +++ b/products/ASC.People/Client/src/components/dialogs/ResetApplicationDialog/index.js @@ -4,6 +4,7 @@ import ModalDialog from "@appserver/components/modal-dialog"; import Button from "@appserver/components/button"; import Text from "@appserver/components/text"; import { withTranslation } from "react-i18next"; +import { withRouter } from "react-router"; import ModalDialogContainer from "../ModalDialogContainer"; import toastr from "studio/toastr"; @@ -13,11 +14,11 @@ class ResetApplicationDialogComponent extends React.Component { } resetApp = async () => { - const { resetTfaApp, id, onClose, logout } = this.props; + const { resetTfaApp, id, onClose, history } = this.props; onClose && onClose(); try { const res = await resetTfaApp(id); - if (res) logout(true, res); + if (res) history.push(res.replace(window.location.origin, "")); } catch (e) { toastr.error(e); } @@ -60,17 +61,17 @@ class ResetApplicationDialogComponent extends React.Component { } } -const ResetApplicationDialog = withTranslation([ - "ResetApplicationDialog", - "Common", -])(ResetApplicationDialogComponent); +const ResetApplicationDialog = withRouter( + withTranslation(["ResetApplicationDialog", "Common"])( + ResetApplicationDialogComponent + ) +); ResetApplicationDialog.propTypes = { visible: PropTypes.bool.isRequired, onClose: PropTypes.func.isRequired, resetTfaApp: PropTypes.func.isRequired, id: PropTypes.string.isRequired, - logout: PropTypes.func.isRequired, }; export default ResetApplicationDialog; diff --git a/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js b/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js index 9a1c941a51..0174fd656e 100644 --- a/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js +++ b/products/ASC.People/Client/src/pages/Profile/Section/Body/index.js @@ -569,7 +569,6 @@ class SectionBodyContent extends React.PureComponent { onClose={this.toggleResetAppDialogVisible} resetTfaApp={this.props.resetTfaApp} id={profile.id} - logout={this.props.logout} /> )} {backupCodesDialogVisible && (