Skip to content

Commit

Permalink
Restrict sent data to a minimal set
Browse files Browse the repository at this point in the history
If data like phone number or postal address are required,
I guess scopes should take care of that, and user have to be informed
what will be sent.
  • Loading branch information
trasher committed Jun 10, 2024
1 parent 1b578b8 commit 3b1a106
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/GaletteOAuth2/Authorization/UserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public static function getUserData(Container $container, int $id, array $options
}
$groups = implode(',', $groups);

$phone = '';
/*$phone = '';
if ($member->phone) {
$phone = $member->phone;
}
Expand All @@ -194,7 +194,7 @@ public static function getUserData(Container $container, int $id, array $options
$phone .= '/';
}
$phone .= $member->gsm;
}
}*/

return [
'id' => $member->id,
Expand All @@ -207,10 +207,10 @@ public static function getUserData(Container $container, int $id, array $options
'mail' => $member->email,
'language' => $member->language,

'country' => $member->country,
/*'country' => $member->country,
'zip' => $member->zipcode,
'city' => $member->town,
'phone' => $phone,
'phone' => $phone,*/

'status' => $member->status,
'groups' => $groups, //nextcloud : set fields Groups claim (optional) = groups
Expand Down
4 changes: 2 additions & 2 deletions tests/GaletteOAuth2/Authorization/tests/units/UserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ public function testGetUserData(): void
'email' => $adh1->email,
'mail' => $adh1->email,
'language' => $adh1->language,
'country' => $adh1->country,
/*'country' => $adh1->country,
'zip' => $adh1->zipcode,
'city' => $adh1->town,
'phone' => $adh1->phone,
'phone' => $adh1->phone,*/
'status' => $adh1->status,
'groups' => 'non-member'
],
Expand Down

0 comments on commit 3b1a106

Please sign in to comment.