Use regex to check for email on RegisterPage

This commit is contained in:
thecashewtrader
2022-11-28 20:36:02 +05:30
parent 74c0795248
commit 66913818b4
2 changed files with 11 additions and 1 deletions

View File

@@ -33,6 +33,8 @@
</template>
<script>
import { isEmail } from "../utils/Misc.js";
export default {
data() {
return {
@@ -52,7 +54,7 @@ export default {
methods: {
register() {
if (!this.username || !this.password) return;
if (this.username.includes("@") && !confirm(this.$t("info.register_no_email_note"))) return;
if (isEmail(this.username) && !confirm(this.$t("info.register_no_email_note"))) return;
this.fetchJson(this.authApiUrl() + "/register", null, {
method: "POST",