1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: relax email checking (#9182)

This commit is contained in:
Mateusz Kwasniewski 2025-01-31 14:50:24 +01:00 committed by GitHub
parent e72a7c1197
commit 9f568b79b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,15 @@ export default class User implements IUser {
if (!id) { if (!id) {
throw new ValidationError('Id is required', [], undefined); throw new ValidationError('Id is required', [], undefined);
} }
Joi.assert(email, Joi.string().email({ ignoreLength: true }), 'Email'); try {
Joi.assert(
email,
Joi.string().email({ ignoreLength: true }),
'Email',
);
} catch (e) {
console.error('Invalid email', email, e);
}
Joi.assert(username, Joi.string(), 'Username'); Joi.assert(username, Joi.string(), 'Username');
Joi.assert(name, Joi.string(), 'Name'); Joi.assert(name, Joi.string(), 'Name');