Skip to content
This repository was archived by the owner on Mar 9, 2021. It is now read-only.

Commit 139eb44

Browse files
committed
Fix issue when opened page is a form
1 parent e21fe2d commit 139eb44

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

file/lib/system/event/listener/ControllerTwoFAListener.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function execute($eventObj, $className, $eventName) {
2424
case 'wcf\action\LogoutAction':
2525
return;
2626
}
27+
2728
require_once(WCF_DIR.'lib/system/api/twofa/PHPGangsta/GoogleAuthenticator.php');
2829

2930
$ga = new \PHPGangsta_GoogleAuthenticator();
@@ -40,6 +41,9 @@ public function execute($eventObj, $className, $eventName) {
4041
if (!isset($_POST['twofaCode']) || mb_strlen($_POST['twofaCode']) === 0) throw new UserInputException('twofaCode');
4142
$twofaHandler->validate($_POST['twofaCode'], WCF::getUser());
4243
WCF::getSession()->register('twofa', true);
44+
45+
\wcf\util\HeaderUtil::redirect($_SERVER['REQUEST_URI']);
46+
exit;
4347
}
4448
catch (\wcf\system\exception\UserInputException $e) {
4549
$errorField = $e->getField();

0 commit comments

Comments
 (0)