From 6375d7ef7fbaa4a6ef2c35f52b689d51f75e3d12 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 24 Aug 2017 12:15:26 +0200 Subject: [PATCH 1/2] Fix undefined index oauthState Signed-off-by: Morris Jobke --- core/Controller/ClientFlowLoginController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php index bec81a89d5..5767c9e1c6 100644 --- a/core/Controller/ClientFlowLoginController.php +++ b/core/Controller/ClientFlowLoginController.php @@ -193,6 +193,7 @@ class ClientFlowLoginController extends Controller { 'urlGenerator' => $this->urlGenerator, 'stateToken' => $stateToken, 'serverHost' => $this->request->getServerHost(), + 'oauthState' => $this->session->get('oauth.state'), ], 'guest' ); From 04583a7587e0038f37ea0216ba217513f93cfb0a Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 6 Sep 2017 11:25:19 +0200 Subject: [PATCH 2/2] Fix tests Signed-off-by: Morris Jobke --- .../Controller/ClientFlowLoginControllerTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index 1132c0f540..89253f1303 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -149,6 +149,11 @@ class ClientFlowLoginControllerTest extends TestCase { ->expects($this->once()) ->method('set') ->with('client.flow.state.token', 'StateToken'); + $this->session + ->expects($this->once()) + ->method('get') + ->with('oauth.state') + ->willReturn('OauthStateToken'); $this->defaults ->expects($this->once()) ->method('getName') @@ -168,6 +173,7 @@ class ClientFlowLoginControllerTest extends TestCase { 'urlGenerator' => $this->urlGenerator, 'stateToken' => 'StateToken', 'serverHost' => 'example.com', + 'oauthState' => 'OauthStateToken', ], 'guest' ); @@ -199,6 +205,11 @@ class ClientFlowLoginControllerTest extends TestCase { ->expects($this->once()) ->method('set') ->with('client.flow.state.token', 'StateToken'); + $this->session + ->expects($this->once()) + ->method('get') + ->with('oauth.state') + ->willReturn('OauthStateToken'); $this->defaults ->expects($this->once()) ->method('getName') @@ -218,6 +229,7 @@ class ClientFlowLoginControllerTest extends TestCase { 'urlGenerator' => $this->urlGenerator, 'stateToken' => 'StateToken', 'serverHost' => 'example.com', + 'oauthState' => 'OauthStateToken', ], 'guest' );