Add validations for the code

This commit is contained in:
Robert Schäfer 2019-06-17 22:51:07 +02:00
parent 0da7b906bd
commit 21506335b5
4 changed files with 33 additions and 5 deletions

View File

@ -63,7 +63,7 @@ export default {
email: {
type: 'email',
required: true,
message: this.$t('common.validations.email'),
message: this.$t('password-reset.form.validations.email'),
},
},
disabled: true,

View File

@ -4,8 +4,8 @@
<ds-form v-model="formData" :schema="formSchema" @submit="handleSubmit">
<ds-input
:placeholder="$t('verify-code.form.input')"
model="token"
name="token"
model="code"
name="code"
icon="question-circle"
/>
<ds-space margin-botton="large">
@ -27,3 +27,24 @@
</ds-space>
</ds-card>
</template>
<script>
export default {
data() {
return {
formData: {
code: '',
},
formSchema: {
code: {
type: 'string',
min: 6,
max: 6,
required: true,
message: this.$t('verify-code.form.validations.code'),
},
},
}
},
}
</script>

View File

@ -24,8 +24,12 @@
},
"verify-code": {
"form": {
"input": "Code eingeben",
"description": "Öffne Deine E-Mail Postfach und gib den Code ein, den wir geschickt haben.",
"submit": "Sicherheitscode überprüfen"
"submit": "Sicherheitscode überprüfen",
"validations": {
"code": "muss genau 6 Buchstaben lang sein"
}
}
},
"editor": {

View File

@ -26,7 +26,10 @@
"form": {
"input": "Enter your code",
"description": "Open your inbox and enter the code that we've sent to you.",
"submit": "Check security code"
"submit": "Check security code",
"validations": {
"code": "must be 6 characters long"
}
}
},
"editor": {