Security field validation: disclose missing field name

This commit is contained in:
Alice Gaudon 2020-07-29 16:16:42 +02:00
parent 5685490048
commit 8ca4c1a791

View File

@ -68,7 +68,7 @@ export default abstract class ApplicationComponent<T> {
protected checkSecurityConfigField(field: string) {
if (!config.has(field) || config.get<string>(field) === 'default') {
throw new SecurityError('field not configured.');
throw new SecurityError(`${field} field not configured.`);
}
}
}