filter emails to search by
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
Sergo 2023-08-04 08:42:51 +03:00
parent 331425bdc4
commit f2ded792c5
2 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@
"wildDuck": {
"url": "http://localhost",
"token": "aaaaa",
"domain": "test-codemowers.eu"
"domain": "test-codemowers.eu",
"preferredDomain": "k-space.ee"
}
}

View File

@ -93,7 +93,9 @@ export class AliasesService<ServiceParams extends AliasesParams = AliasesParams>
const emails = params.session?.user?.emails;
const addressInfoResponse = await Promise.any(
emails.map((email: string) =>
emails
.filter((email: string) => email.endsWith(config.get("wildDuck.preferredDomain")))
.map((email: string) =>
wildDuckClient.get<Alias>(`addresses/resolve/${email}`),
),
);