diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-06-19 21:40:45 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-06-20 08:57:13 +0200 |
commit | 5455045a9be8525ecdcf700651c391ee7215d954 (patch) | |
tree | 97173d0ac3fbe016ef68dc4317c3c1f8a03ce8b1 | |
parent | 6de656e435f7668b9f447413e397ad9e1e304bf8 (diff) | |
download | nextcloud-server-5455045a9be8525ecdcf700651c391ee7215d954.tar.gz nextcloud-server-5455045a9be8525ecdcf700651c391ee7215d954.zip |
Fix direct access to authen page
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | lib/public/AppFramework/AuthPublicShareController.php | 4 | ||||
-rw-r--r-- | tests/lib/AppFramework/Controller/AuthPublicShareControllerTest.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/public/AppFramework/AuthPublicShareController.php b/lib/public/AppFramework/AuthPublicShareController.php index 069d0becba3..ffd2bddd24b 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 82802c28095..169ec82ce6d 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']]); |