diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php index 069d0becba..ffd2bddd24 100644 --- a/lib/public/AppFramework/AuthPublicShareController.php +++ b/lib/public/AppFramework/AuthPublicShareController.php @@ -176,7 +176,9 @@ abstract class AuthPublicShareController extends PublicShareController { $route = $this->getRoute('showShare'); if ($params === null) { - $params = []; + $params = [ + 'token' => $this->getToken(), + ]; } else { $params = json_decode($params, true); if (isset($params['_route'])) { diff --git a/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php b/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php index 82802c2809..169ec82ce6 100644 --- a/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php +++ b/tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php @@ -83,6 +83,8 @@ class AuthPublicShareControllerTest extends \Test\TestCase { $this->controller->method('isAuthenticated') ->willReturn(true); + $this->controller->setToken('myToken'); + $this->session->method('get') ->willReturnMap(['public_link_authenticate_redirect', ['foo' => 'bar']]);