Skip to content

Commit 12deed6

Browse files
committed
less magic numbers
1 parent bd02e90 commit 12deed6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interface/web/login/otp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
$msg = '';
4949
$max_session_code_retry = 3;
5050
$max_global_code_retry = 10;
51-
51+
$otp_recovery_code_length = 32;
5252

5353
//* CSRF Check if we got POST data
5454
if(count($_POST) >= 1) {
@@ -61,7 +61,7 @@
6161

6262

6363
//* Handle recovery code
64-
if(isset($_POST['code']) && strlen($_POST['code']) == 32 && $_SESSION['otp']['recovery']) {
64+
if(isset($_POST['code']) && strlen($_POST['code']) == $otp_recovery_code_length && $_SESSION['otp']['recovery']) {
6565
//* TODO Recovery code handling
6666

6767
$user = $app->db->queryOneRecord('SELECT otp_attempts FROM sys_user WHERE userid = ?',$_SESSION['s_pending']['user']['userid']);

0 commit comments

Comments
 (0)