Skip to content

Commit

Permalink
fix(ProvisioningApi): only return verified additional mails per user
Browse files Browse the repository at this point in the history
It would not per se be bad to return all of them, however the meta data
about the verified state is missing. Since the information may go out to
connected clients, those may have wrong trust the returned email
addresses.

Email verification still works with this change.

Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Mar 19, 2024
1 parent 0681141 commit 266a79a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/provisioning_api/lib/Controller/AUserData.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ protected function getUserData(string $userId, bool $includeScopes = false): ?ar
$additionalEmails = $additionalEmailScopes = [];
$emailCollection = $userAccount->getPropertyCollection(IAccountManager::COLLECTION_EMAIL);
foreach ($emailCollection->getProperties() as $property) {
if ($property->getLocallyVerified() !== IAccountManager::VERIFIED) {
continue;
}
$additionalEmails[] = $property->getValue();
if ($includeScopes) {
$additionalEmailScopes[] = $property->getScope();
Expand Down

0 comments on commit 266a79a

Please sign in to comment.