filter emails to search by
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Sergo 2023-08-04 08:42:51 +03:00 committed by Lauri Võsandi
parent d09de4be01
commit 495e8057c8
2 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@
"wildDuck": { "wildDuck": {
"url": "http://localhost", "url": "http://localhost",
"token": "aaaaa", "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 emails = params.session?.user?.emails;
const addressInfoResponse = await Promise.any( 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}`), wildDuckClient.get<Alias>(`addresses/resolve/${email}`),
), ),
); );