fix: validateSMTPUrl check

This commit is contained in:
Mir Arif Hasan
2023-12-07 16:29:31 +06:00
parent 8035d1d592
commit 94ca981144
2 changed files with 12 additions and 27 deletions

View File

@@ -16,7 +16,7 @@ import {
INFRA_CONFIG_RESET_FAILED,
INFRA_CONFIG_UPDATE_FAILED,
} from 'src/errors';
import { throwErr, validateUrl } from 'src/utils';
import { throwErr, validateSMTPUrl } from 'src/utils';
import { ConfigService } from '@nestjs/config';
import { AuthProviderStatus, stopApp } from './helper';
import { EnableAndDisableSSOArgs, InfraConfigArgs } from './input-args';
@@ -302,7 +302,7 @@ export class InfraConfigService implements OnModuleInit {
) {
for (let i = 0; i < infraConfigs.length; i++) {
if (infraConfigs[i].name === InfraConfigEnumForClient.MAILER_SMTP_URL) {
const isValidUrl = validateUrl(infraConfigs[i].value);
const isValidUrl = validateSMTPUrl(infraConfigs[i].value);
if (!isValidUrl) return E.left(INFRA_CONFIG_INVALID_INPUT);
}
}