Skip to content

Commit 715c6ee

Browse files
committed
OXDEV-9078 Fix the code verification action name in the controller
As its not OTP specific, its general verification Signed-off-by: Anton Fedurtsya <anton@fedurtsya.com>
1 parent c7e2e20 commit 715c6ee

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Authentication/TwoFactorAuth/Controller/TwoFactorAuthController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function render(): string
5454
return $this->_sThisTemplate;
5555
}
5656

57-
public function handleOTP(): ?string
57+
public function verifyCode(): ?string
5858
{
5959
$userId = $this->twoFAUserService->getPendingUserId();
6060
$code = $this->authCodeRequest->getCode();

tests/Unit/Authentication/TwoFactorAuth/Controller/TwoFactorAuthControllerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class TwoFactorAuthControllerTest extends TestCase
2525
{
2626
#[Test]
27-
public function handleOTPVerifiesCodeAndLoginsUser(): void
27+
public function verifyCodeVerifiesCodeAndLoginsUser(): void
2828
{
2929
$userId = uniqid();
3030
$code = uniqid();
@@ -49,11 +49,11 @@ public function handleOTPVerifiesCodeAndLoginsUser(): void
4949
authCodeRequest: $authCodeRequestStub,
5050
);
5151

52-
$sut->handleOTP();
52+
$sut->verifyCode();
5353
}
5454

5555
#[Test]
56-
public function handleOTPDisplaysErrorOnInvalidCode(): void
56+
public function verifyCodeDisplaysErrorOnInvalidCode(): void
5757
{
5858
$exception = new InvalidCodeException();
5959

@@ -70,7 +70,7 @@ public function handleOTPDisplaysErrorOnInvalidCode(): void
7070
utilsView: $utilsViewSpy,
7171
);
7272

73-
$sut->handleOTP();
73+
$sut->verifyCode();
7474
}
7575

7676
#[Test]

views/twig/templates/two_factor_auth.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="hidden">
1414
{{ oViewConf.getHiddenSid()|raw }}
1515
<input type="hidden" name="cl" value="twofactorauth">
16-
<input type="hidden" name="fnc" value="handleOTP">
16+
<input type="hidden" name="fnc" value="verifyCode">
1717
</div>
1818

1919
<div class="row">

0 commit comments

Comments
 (0)