Skip to content

Commit

Permalink
Merge pull request massif-press#2085 from super-salad/email_fix
Browse files Browse the repository at this point in the history
fix(sign in): require email for verification code functions
  • Loading branch information
jarena3 authored Aug 11, 2022
2 parents 5a62059 + 940e35d commit 0ab3a31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/features/main_menu/_components/login/SignIn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<v-text-field v-model="email" label="E-Mail Address" dense outlined hide-details />
<div>
<v-fade-transition>
<div @click="$emit('reverify', email)">
<a>
<i>Have a validation code? Click here.</i>
<div>
<a v-if="email && emailValid()" @click="$emit('reverify', email)">
<i>Click here to use a verification code.</i>
</a>
<i v-else-if="!email">Have a verification code? Enter your email to use it.</i>
<i v-else>Please enter a valid email address</i>
</div>
</v-fade-transition>
</div>
Expand Down Expand Up @@ -127,6 +129,9 @@ export default Vue.extend({
this.error = `${error.message}<br><div class='text-right'>${error.name}</div>`
})
},
emailValid(){
return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this.email)
}
},
})
</script>
2 changes: 1 addition & 1 deletion src/features/main_menu/_components/login/Verify.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<v-col cols="auto" style="letter-spacing: 5px">VERIFY E-MAIL ADDRESS</v-col>
</v-row>
<p class="body-text text-center mt-2">
An authorization code has been sent to
A verification code was sent to
<b>{{ email }}</b>
. Input the code below to finalize your account
</p>
Expand Down

0 comments on commit 0ab3a31

Please sign in to comment.