Remove the defaultValue, stored email, etc...

This commit is contained in:
elweyn 2022-03-11 12:54:08 +01:00
parent 016f5ef657
commit 08dd7c3518
4 changed files with 2 additions and 17 deletions

View File

@ -4,7 +4,6 @@
:rules="rules"
:name="name"
v-slot="{ errors, valid, validated, ariaInput, ariaMsg }"
immediate
>
<b-form-group :label="label" :label-for="labelFor">
<b-form-input
@ -39,11 +38,10 @@ export default {
label: { type: String, default: 'Email' },
placeholder: { type: String, default: 'Email' },
value: { required: true, type: String },
defaultValue: { type: String },
},
data() {
return {
currentValue: this.defaultValue !== undefined ? this.defaultValue : '',
currentValue: '',
}
},
computed: {
@ -59,10 +57,5 @@ export default {
if (this.value !== this.currentValue) this.currentValue = this.value
},
},
mounted() {
if (this.defaultValue !== undefined) {
this.$emit('input', this.currentValue)
}
},
}
</script>

View File

@ -28,11 +28,6 @@ const createMockObject = (comingFrom) => {
comingFrom,
},
},
$store: {
state: {
email: undefined,
},
},
},
stubs,
}

View File

@ -19,7 +19,7 @@
<b-card-body class="p-4">
<validation-observer ref="observer" v-slot="{ handleSubmit }">
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
<input-email v-model="form.email" :defaultValue="defaultEmail"></input-email>
<input-email v-model="form.email"></input-email>
<div class="text-center">
<b-button type="submit" variant="primary">
{{ $t(displaySetup.button) }}
@ -68,7 +68,6 @@ export default {
email: '',
},
displaySetup: {},
defaultEmail: this.$store.state.email,
}
},
methods: {

View File

@ -107,10 +107,8 @@ export default {
.catch((error) => {
this.toastError(this.$t('error.no-account'))
if (error.message.includes('User email not validated')) {
this.$store.commit('email', this.form.email)
this.$router.push('/thx/login')
} else if (error.message.includes('User has no password set yet')) {
this.$store.commit('email', this.form.email)
this.$router.push('/reset-password/login')
}
loader.hide()