Skip to content

Commit

Permalink
fixup! fix(auth): Keep redirect URL during 2FA setup and challenge
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
  • Loading branch information
ChristophWurst committed Apr 19, 2024
1 parent 8fbd8cc commit dc9f352
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/Core/Controller/TwoFactorChallengeControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public function testSolveChallengeTwoFactorException() {
$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')
Expand All @@ -357,6 +357,7 @@ public function testSetUpProviders() {
$provider,
],
'logout_url' => 'logoutAttribute',
'redirect_url' => null,
],
'guest'
);
Expand Down Expand Up @@ -392,7 +393,7 @@ public function testSetUpInvalidProvider() {
$this->assertEquals($expected, $response);
}

public function testSetUpProvider() {
public function testSetUpProvider(): void {
$user = $this->createMock(IUser::class);
$this->userSession->expects($this->once())
->method('getUser')
Expand Down Expand Up @@ -426,6 +427,7 @@ public function testSetUpProvider() {
'provider' => $provider,
'logout_url' => 'logoutAttribute',
'template' => 'tmpl',
'redirect_url' => null,
],
'guest'
);
Expand All @@ -435,13 +437,14 @@ public function testSetUpProvider() {
$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');
Expand Down

0 comments on commit dc9f352

Please sign in to comment.