fix(federation): Return the used userID to allow the inviting server to react to the famous `mapUid` result

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/47195/head
Joas Schilling 2 years ago
parent cee227ae99
commit 15a530008f
No known key found for this signature in database
GPG Key ID: 74434EFE0D2E2205
  1. 17
      apps/cloud_federation_api/lib/Controller/RequestHandlerController.php
  2. 1
      apps/cloud_federation_api/lib/ResponseDefinitions.php
  3. 3
      apps/cloud_federation_api/openapi.json

@ -173,15 +173,18 @@ class RequestHandlerController extends Controller {
);
}
$user = $this->userManager->get($shareWith);
$recipientDisplayName = '';
if ($user) {
$recipientDisplayName = $user->getDisplayName();
$responseData = ['recipientDisplayName' => ''];
if ($shareType === 'user') {
$user = $this->userManager->get($shareWith);
if ($user) {
$responseData = [
'recipientDisplayName' => $user->getDisplayName(),
'recipientUserId' => $user->getUID(),
];
}
}
return new JSONResponse(
['recipientDisplayName' => $recipientDisplayName],
Http::STATUS_CREATED);
return new JSONResponse($responseData, Http::STATUS_CREATED);
}
/**

@ -12,6 +12,7 @@ namespace OCA\CloudFederationAPI;
/**
* @psalm-type CloudFederationAPIAddShare = array{
* recipientDisplayName: string,
* recipientUserId?: string,
* }
*
* @psalm-type CloudFederationAPIError = array{

@ -28,6 +28,9 @@
"properties": {
"recipientDisplayName": {
"type": "string"
},
"recipientUserId": {
"type": "string"
}
}
},

Loading…
Cancel
Save