mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-17 09:15:41 +00:00
Literally don't be an idiot
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user