diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2024-04-09 08:12:21 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-04-23 07:35:46 +0000 |
commit | c3e269d01e02553483377a8ffaca9c36b93df47a (patch) | |
tree | 2b6475ba7f4d85b4b3746cab92a8712cd6bec5dd /tests/Core/Controller/TwoFactorChallengeControllerTest.php | |
parent | e4147017717c2df9d4679e008f1483528fec81a2 (diff) | |
download | nextcloud-server-backport/44745/stable27.tar.gz nextcloud-server-backport/44745/stable27.zip |
fix(auth): Keep redirect URL during 2FA setup and challengebackport/44745/stable27
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
[skip ci]
Diffstat (limited to 'tests/Core/Controller/TwoFactorChallengeControllerTest.php')
-rw-r--r-- | tests/Core/Controller/TwoFactorChallengeControllerTest.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index baf7feaa068..c937b925997 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -337,7 +337,7 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token', '/url')); } - public function testSetUpProviders() { + public function testSetUpProviders(): void { $user = $this->createMock(IUser::class); $this->userSession->expects($this->once()) ->method('getUser') @@ -357,6 +357,7 @@ class TwoFactorChallengeControllerTest extends TestCase { $provider, ], 'logout_url' => 'logoutAttribute', + 'redirect_url' => null, ], 'guest' ); @@ -392,7 +393,7 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->assertEquals($expected, $response); } - public function testSetUpProvider() { + public function testSetUpProvider(): void { $user = $this->createMock(IUser::class); $this->userSession->expects($this->once()) ->method('getUser') @@ -426,6 +427,7 @@ class TwoFactorChallengeControllerTest extends TestCase { 'provider' => $provider, 'logout_url' => 'logoutAttribute', 'template' => 'tmpl', + 'redirect_url' => null, ], 'guest' ); @@ -435,13 +437,14 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->assertEquals($expected, $response); } - public function testConfirmProviderSetup() { + public function testConfirmProviderSetup(): void { $this->urlGenerator->expects($this->once()) ->method('linkToRoute') ->with( 'core.TwoFactorChallenge.showChallenge', [ 'challengeProviderId' => 'totp', + 'redirect_url' => null, ]) ->willReturn('2fa/select/page'); $expected = new RedirectResponse('2fa/select/page'); |