Skip to content

Commit

Permalink
fix(openapi): Fix always empty data response of public share auth
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Nov 27, 2024
1 parent 7f249d0 commit b6efaeb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Controller/PublicShareAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(
* otherwise.
*
* @param string $shareToken Token of the file share
* @return DataResponse<Http::STATUS_CREATED, array{token: string, name: string, displayName: string}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, array<empty>, array{}>
* @return DataResponse<Http::STATUS_CREATED, array{token: string, name: string, displayName: string}, array{}>|DataResponse<Http::STATUS_NOT_FOUND, null, array{}>
*
* 201: Room created successfully
* 404: Share not found
Expand All @@ -59,18 +59,18 @@ public function __construct(
public function createRoom(string $shareToken): DataResponse {
try {
$share = $this->shareManager->getShareByToken($shareToken);
} catch (ShareNotFound $e) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
} catch (ShareNotFound) {
return new DataResponse(null, Http::STATUS_NOT_FOUND);
}

if (!$share->getSendPasswordByTalk()) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
return new DataResponse(null, Http::STATUS_NOT_FOUND);
}

$sharerUser = $this->userManager->get($share->getSharedBy());

if (!$sharerUser instanceof IUser) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
return new DataResponse(null, Http::STATUS_NOT_FOUND);
}

if ($share->getShareType() === IShare::TYPE_EMAIL) {
Expand Down

0 comments on commit b6efaeb

Please sign in to comment.