web/satellite: logout added after password change
functionality moved from reset password where no cookie and causes error to proper place added redirect with 2 sec delay after success Change-Id: I9cfe7e88bed7cfaf04fc7dc7fde58702b0040c5c
This commit is contained in:
parent
7aaab3c4c4
commit
0317c819dc
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user