{
+ await axios.delete('/api/v4/user', {
+ data: {
+ password: this.passwordValue,
+ feedback: this.feedback,
+ },
+ });
+ localStorage.clear();
+ window.location.href = '/static/home';
});
- localStorage.clear();
- window.location.href = '/static/home';
},
},
};
diff --git a/website/client/src/pages/settings/settingRows/resetAccount.vue b/website/client/src/pages/settings/settingRows/resetAccount.vue
index 178397362c..df4cc39978 100644
--- a/website/client/src/pages/settings/settingRows/resetAccount.vue
+++ b/website/client/src/pages/settings/settingRows/resetAccount.vue
@@ -66,6 +66,8 @@
{
+ await axios.post('/api/v4/user/reset', {
+ password: this.passwordValue,
+ });
+ this.$router.push('/');
+ setTimeout(() => window.location.reload(true), 100);
});
- this.$router.push('/');
- setTimeout(() => window.location.reload(true), 100);
},
},
};
diff --git a/website/client/src/pages/settings/settingRows/userEmailSetting.vue b/website/client/src/pages/settings/settingRows/userEmailSetting.vue
index fefb4ef713..5fcf54f8cb 100644
--- a/website/client/src/pages/settings/settingRows/userEmailSetting.vue
+++ b/website/client/src/pages/settings/settingRows/userEmailSetting.vue
@@ -47,8 +47,8 @@
@@ -76,10 +76,11 @@ import { InlineSettingMixin } from '../components/inlineSettingMixin';
import CurrentPasswordInput from '../components/currentPasswordInput.vue';
import ValidatedTextInput from '@/components/ui/validatedTextInput.vue';
import NotificationMixins from '@/mixins/notifications';
+import { PasswordInputChecksMixin } from '@/mixins/passwordInputChecks';
export default {
components: { ValidatedTextInput, CurrentPasswordInput, SaveCancelButtons },
- mixins: [InlineSettingMixin, NotificationMixins],
+ mixins: [InlineSettingMixin, NotificationMixins, PasswordInputChecksMixin],
data () {
return {
updates: {
@@ -87,7 +88,6 @@ export default {
password: '',
},
emailChanged: false,
- passwordIssues: [],
};
},
computed: {
@@ -117,22 +117,12 @@ export default {
this.updates.newEmail = this.user.auth.local.email;
},
async changeEmail () {
- try {
- this.passwordIssues.length = 0;
+ await this.passwordInputCheckMixinTryCall(async () => {
await axios.put('/api/v4/user/auth/update-email', this.updates);
-
- this.passwordIssues.length = 0;
-
this.user.auth.local.email = this.updates.newEmail;
this.text(this.$t('emailSuccess'));
this.closeModal();
- } catch (axiosError) {
- const message = axiosError.response?.data?.message;
-
- if (message === this.$t('wrongPassword')) {
- this.passwordIssues.push(message);
- }
- }
+ });
},
},
};