* Validate array of emails. Intended to be used with create/update users
(input: string | string[])
| 170 | * Validate array of emails. Intended to be used with create/update users |
| 171 | */ |
| 172 | private validateEmail(input: string | string[]) { |
| 173 | const emails = Array.isArray(input) ? input : [input]; |
| 174 | |
| 175 | const schema = Joi.string().email().required(); |
| 176 | |
| 177 | for (const email of emails) { |
| 178 | const { error } = schema.validate(email); |
| 179 | |
| 180 | if (error) { |
| 181 | throw new FailedValidationError({ |
| 182 | field: 'email', |
| 183 | type: 'email', |
| 184 | path: [], |
| 185 | }); |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Block setting a non-default auth provider when the current license isn't entitled to SSO |
no test coverage detected