Registration and activation

This commit is contained in:
Torsten Schulz
2024-07-20 20:43:18 +02:00
parent 3880a265eb
commit bbf4a2deb3
51 changed files with 3016 additions and 69 deletions

View File

@@ -0,0 +1,45 @@
<template>
<DialogWidget ref="dialog" title="passwordReset.title" :show-close=true :buttons="buttons" @close="closeDialog" name="PasswordReset">
<div>
<label>{{ $t("passwordReset.email") }} <input type="email" v-model="email" required /></label>
</div>
</DialogWidget>
</template>
<script>
import apiClient from '@/utils/axios.js';
import DialogWidget from '@/components/DialogWidget.vue';
export default {
name: 'PasswordResetDialog',
components: {
DialogWidget,
},
data() {
return {
email: '',
buttons: [{ text: this.$t("passwordReset.reset") }]
};
},
methods: {
open() {
this.$refs.dialog.open();
},
closeDialog() {
this.$refs.dialog.close();
},
async resetPassword() {
try {
await apiClient.post('/api/users/requestPasswordReset', {
email: this.email
});
this.$refs.dialog.close();
alert(this.$t("passwordReset.success"));
} catch (error) {
console.error('Error resetting password:', error);
alert(this.$t("passwordReset.failure"));
}
}
}
};
</script>