Skip to content
Merged
Prev Previous commit
Next Next commit
fix: Use userId as a fallback for new file creation token
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Sep 11, 2023
commit 9ae189fbac234b5f69c35d99f7d39b517414bc8c
2 changes: 1 addition & 1 deletion lib/Controller/DocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ private function getToken(File $file, ?IShare $share = null, int $version = null
// Pass through $version
$templateFile = $this->templateManager->getTemplateSource($file->getId());
if ($templateFile) {
return $this->tokenManager->generateWopiTokenForTemplate($templateFile, $share?->getShareOwner(), $file->getId());
return $this->tokenManager->generateWopiTokenForTemplate($templateFile, $share?->getShareOwner() ?? $this->userId, $file->getId());
}

return $this->tokenManager->generateWopiToken($this->getWopiFileId($file->getId(), $version), $share?->getToken(), $this->userId);
Expand Down