Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private validateConfiguration(config: Configuration): void {
if (!config) {
throw new AccountsError('TokenManager', 'configuration', 'A configuration object is needed');
}
if (typeof config.secret !== 'string') {
throw new AccountsError('TokenManager', 'configuration', 'A string secret property is needed');
}
}
}
private validateConfiguration(config: Configuration): void {
if (!config) {
throw new AccountsError('TokenManager', 'configuration', 'A configuration object is needed');
}
if (typeof config.secret !== 'string') {
throw new AccountsError('TokenManager', 'configuration', 'A string secret property is needed');
}
}
}
public notify (notificationPluginName: string, actionName: string, params: object): void {
const plugin = this.plugins[notificationPluginName];
if(!plugin){
throw new AccountsError('EmailNotificationServiceDebug','notify',`The plugin "${notificationPluginName}" is not registered`)
}
const action = plugin[actionName];
if(!action){
throw new AccountsError('EmailNotificationServiceDebug','notify',`The action "${actionName}" is not found on plugin "${notificationPluginName}"`)
}
action(this.send, params);
}