diff --git a/web/satellite/src/components/account/ChangePasswordPopup.vue b/web/satellite/src/components/account/ChangePasswordPopup.vue index 0697d6b12..1e98b4b31 100644 --- a/web/satellite/src/components/account/ChangePasswordPopup.vue +++ b/web/satellite/src/components/account/ChangePasswordPopup.vue @@ -77,10 +77,13 @@ import CloseCrossIcon from '@/../static/images/common/closeCross.svg'; import { AuthHttpApi } from '@/api/auth'; import { APP_STATE_ACTIONS } from '@/utils/constants/actionNames'; import { Validator } from '@/utils/validation'; +import { RouteConfig } from "@/router"; import { AnalyticsHttpApi } from '@/api/analytics'; import { AnalyticsEvent } from '@/utils/constants/analyticsEventNames'; +const DELAY_BEFORE_REDIRECT = 2000; // 2 sec + // @vue/component @Component({ components: { @@ -169,6 +172,16 @@ export default class ChangePasswordPopup extends Vue { return; } + try { + await this.auth.logout(); + + setTimeout(() => { + this.$router.push(RouteConfig.Login.path); + }, DELAY_BEFORE_REDIRECT); + } catch (error) { + await this.$notify.error(error.message); + } + this.analytics.eventTriggered(AnalyticsEvent.PASSWORD_CHANGED); await this.$notify.success('Password successfully changed!'); this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_CHANGE_PASSWORD_POPUP); diff --git a/web/satellite/src/views/ResetPassword.vue b/web/satellite/src/views/ResetPassword.vue index 0994edb9b..5901d8b44 100644 --- a/web/satellite/src/views/ResetPassword.vue +++ b/web/satellite/src/views/ResetPassword.vue @@ -181,7 +181,6 @@ export default class ResetPassword extends Vue { try { await this.auth.resetPassword(this.token, this.password, this.passcode.trim(), this.recoveryCode.trim()); - await this.auth.logout(); this.$store.dispatch(APP_STATE_ACTIONS.TOGGLE_SUCCESSFUL_PASSWORD_RESET); } catch (error) { this.isLoading = false;