summary refs log tree commit diff
path: root/util
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 00:08:34 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-25 00:08:34 +1000
commitc1d59c629804337ceb42795fa50dc7eaf1fbd7c7 (patch)
treeeb36408854f6d7c955a0a7f1a72ffd20d612f3fa /util
parentPotential nick reset fix (diff)
downloadserver-c1d59c629804337ceb42795fa50dc7eaf1fbd7c7.tar.xz
Literally don't be an idiot
Diffstat (limited to 'util')
-rw-r--r--util/src/entities/User.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/util/src/entities/User.ts b/util/src/entities/User.ts

index 5ae90c7c..35aeea52 100644 --- a/util/src/entities/User.ts +++ b/util/src/entities/User.ts
@@ -140,11 +140,9 @@ export class User extends BaseClass { email?: string; // email of the user setEmail(val?: string) { - if (val) { - val = adjustEmail(val); - if (!val) throw FieldErrors({ email: { message: "Invalid email", code: "EMAIL_INVALID" } }); - if (!val.match(/([a-z\d.-]{3,})@([a-z\d.-]+).([a-z]{2,})/g)) throw FieldErrors({ email: { message: "Invalid email", code: "EMAIL_INVALID" } }); - } + val = adjustEmail(val); + if (!val) throw FieldErrors({ email: { message: "Invalid email", code: "EMAIL_INVALID" } }); + if (!val.match(/([a-z\d.-]{3,})@([a-z\d.-]+).([a-z]{2,})/g)) throw FieldErrors({ email: { message: "Invalid email", code: "EMAIL_INVALID" } }); this.email = val; }