Oh, forgot, you have to add the email again

Well, this is not good practice. If an attacker has access to the
mailbox then she knows also the email account as well. It's better to
ask the user for the unique username, e.g. `@username`.

https://stackoverflow.com/a/16018373
This commit is contained in:
Robert Schäfer 2019-06-18 13:23:37 +02:00
parent 288e5002fd
commit 559210d204
4 changed files with 22 additions and 7 deletions

View File

@ -41,7 +41,8 @@ describe('VerifyCode ', () => {
describe('after verification code given', () => { describe('after verification code given', () => {
beforeEach(() => { beforeEach(() => {
wrapper = Wrapper() wrapper = Wrapper()
wrapper.find('input').setValue('123456') wrapper.find('input#email').setValue('mail@example.org')
wrapper.find('input#code').setValue('123456')
wrapper.find('form').trigger('submit') wrapper.find('form').trigger('submit')
}) })

View File

@ -2,7 +2,7 @@
<ds-card class="verify-code"> <ds-card class="verify-code">
<ds-space margin="large"> <ds-space margin="large">
<ds-form <ds-form
v-if="!codeSubmitted" v-if="!verificationSubmitted"
v-model="verification.formData" v-model="verification.formData"
:schema="verification.formSchema" :schema="verification.formSchema"
@submit="handleSubmitVerify" @submit="handleSubmitVerify"
@ -10,9 +10,17 @@
@input-valid="handleInputValid" @input-valid="handleInputValid"
> >
<ds-input <ds-input
:placeholder="$t('verify-code.form.input')" :placeholder="$t('login.email')"
model="email"
id="email"
name="email"
icon="envelope"
/>
<ds-input
:placeholder="$t('verify-code.form.code')"
model="code" model="code"
name="code" name="code"
id="code"
icon="question-circle" icon="question-circle"
/> />
<ds-space margin-botton="large"> <ds-space margin-botton="large">
@ -68,9 +76,15 @@ export default {
return { return {
verification: { verification: {
formData: { formData: {
email: '',
code: '', code: '',
}, },
formSchema: { formSchema: {
email: {
type: 'email',
required: true,
message: this.$t('common.validations.email'),
},
code: { code: {
type: 'string', type: 'string',
min: 6, min: 6,
@ -103,7 +117,7 @@ export default {
], ],
}, },
}, },
codeSubmitted: false, verificationSubmitted: false,
disabled: true, disabled: true,
} }
}, },
@ -115,7 +129,7 @@ export default {
this.disabled = false this.disabled = false
}, },
handleSubmitVerify() { handleSubmitVerify() {
this.codeSubmitted = true this.verificationSubmitted = true
}, },
handleSubmitPassword() {}, handleSubmitPassword() {},
matchPassword(rule, value, callback, source, options) { matchPassword(rule, value, callback, source, options) {

View File

@ -24,7 +24,7 @@
}, },
"verify-code": { "verify-code": {
"form": { "form": {
"input": "Code eingeben", "code": "Code eingeben",
"description": "Öffne Deine E-Mail Postfach und gib den Code ein, den wir geschickt haben.", "description": "Öffne Deine E-Mail Postfach und gib den Code ein, den wir geschickt haben.",
"submit": "Sicherheitscode überprüfen", "submit": "Sicherheitscode überprüfen",
"change-password":{ "change-password":{

View File

@ -24,7 +24,7 @@
}, },
"verify-code": { "verify-code": {
"form": { "form": {
"input": "Enter your code", "code": "Enter your code",
"description": "Open your inbox and enter the code that we've sent to you.", "description": "Open your inbox and enter the code that we've sent to you.",
"submit": "Check security code", "submit": "Check security code",
"change-password": { "change-password": {