From 92582a350d295f123d08f16f09e06baa4bc4733c Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 31 Oct 2018 23:06:08 +0100 Subject: Use the proper server for the apptoken flow login If a user can't authenticate normally (because they have 2FA that is not available on their devices for example). The redirect that is generated should be of the proper format. This means 1. Include the protocol 2. Include the possible subfolder Signed-off-by: Roeland Jago Douma --- tests/Core/Controller/ClientFlowLoginControllerTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php index 7fe87df026f..b54897ddc44 100644 --- a/tests/Core/Controller/ClientFlowLoginControllerTest.php +++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php @@ -162,6 +162,9 @@ class ClientFlowLoginControllerTest extends TestCase { ->expects($this->once()) ->method('getServerHost') ->willReturn('example.com'); + $this->request + ->method('getServerProtocol') + ->willReturn('https'); $expected = new TemplateResponse( 'core', @@ -172,7 +175,7 @@ class ClientFlowLoginControllerTest extends TestCase { 'instanceName' => 'ExampleCloud', 'urlGenerator' => $this->urlGenerator, 'stateToken' => 'StateToken', - 'serverHost' => 'example.com', + 'serverHost' => 'https://example.com', 'oauthState' => 'OauthStateToken', ], 'guest' @@ -218,6 +221,9 @@ class ClientFlowLoginControllerTest extends TestCase { ->expects($this->once()) ->method('getServerHost') ->willReturn('example.com'); + $this->request + ->method('getServerProtocol') + ->willReturn('https'); $expected = new TemplateResponse( 'core', @@ -228,7 +234,7 @@ class ClientFlowLoginControllerTest extends TestCase { 'instanceName' => 'ExampleCloud', 'urlGenerator' => $this->urlGenerator, 'stateToken' => 'StateToken', - 'serverHost' => 'example.com', + 'serverHost' => 'https://example.com', 'oauthState' => 'OauthStateToken', ], 'guest' -- cgit v1.2.3