Skip to content

Commit

Permalink
set default value
Browse files Browse the repository at this point in the history
  • Loading branch information
sszafGCA committed Oct 25, 2023
1 parent 7b24e77 commit da27ee2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions apps/server/src/modules/server/server.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const config: IServerConfig = {
FEATURE_IDENTITY_MANAGEMENT_ENABLED: Configuration.get('FEATURE_IDENTITY_MANAGEMENT_ENABLED') as boolean,
FEATURE_IDENTITY_MANAGEMENT_STORE_ENABLED: Configuration.get('FEATURE_IDENTITY_MANAGEMENT_STORE_ENABLED') as boolean,
FEATURE_IDENTITY_MANAGEMENT_LOGIN_ENABLED: Configuration.get('FEATURE_IDENTITY_MANAGEMENT_LOGIN_ENABLED') as boolean,
BLACKLISTED_DOMAINS: Configuration.has('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS')
? (Configuration.get('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS') as string).split(',').map((domain) => domain.trim())
: ([] as string[]),
ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS: (Configuration.get('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS') as string)
.split(',')
.map((domain) => domain.trim()),
};

export const serverConfig = () => config;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface IMailConfig {
BLACKLISTED_DOMAINS: string[];
ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS: string[];
}
2 changes: 1 addition & 1 deletion apps/server/src/shared/infra/mail/mail.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class MailService {
@Inject('MAIL_SERVICE_OPTIONS') private readonly options: MailServiceOptions,
private readonly configService: ConfigService<IMailConfig, true>
) {
this.domainBlacklist = this.configService.get<string[]>('BLACKLISTED_DOMAINS');
this.domainBlacklist = this.configService.get<string[]>('ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS');
}

public async send(data: Mail): Promise<void> {
Expand Down
1 change: 1 addition & 0 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
},
"ADDITIONAL_BLACKLISTED_EMAIL_DOMAINS": {
"type": "string",
"default":"",
"description": "Add custom domain to the list of blocked domains (comma separated list)."
},
"FEATURE_TSP_AUTO_CONSENT_ENABLED": {
Expand Down

0 comments on commit da27ee2

Please sign in to comment.