Skip to content

Commit 745b73c

Browse files
committed
Reset the attempt counter when successfully logged in
1 parent 50352f2 commit 745b73c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

interface/web/login/otp.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
//* 2fa success
106106
if($_POST['code'] == $_SESSION['otp']['code']) {
107107
$_SESSION['s'] = $_SESSION['s_pending'];
108+
// Reset the attempt counter.
109+
$app->db->query('UPDATE `sys_user` SET otp_attempts=0 WHERE userid = ?', $_SESSION['s']['user']['userid']);
108110
unset($_SESSION['s_pending']);
109111
unset($_SESSION['otp']);
110112
header('Location: ../index.php');
@@ -185,6 +187,7 @@
185187
$csrf_token = $app->auth->csrf_token_get('language_edit');
186188
$app->tpl->setVar('_csrf_id',$csrf_token['csrf_id']);
187189
$app->tpl->setVar('_csrf_key',$csrf_token['csrf_key']);
190+
#$app->tpl->setVar('msg', print_r($_SESSION['otp'], 1));
188191

189192

190193
require ISPC_ROOT_PATH.'/web/login/lib/lang/'.$app->functions->check_language($conf['language']).'.lng';

0 commit comments

Comments
 (0)