From 561d6cd45003ebea9f703804098da0ffaa2c6168 Mon Sep 17 00:00:00 2001 From: Marco Date: Tue, 2 Apr 2024 13:52:22 +0200 Subject: [PATCH] In tests show whether 2FA is currently pending for any user --- tests/index.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/index.php b/tests/index.php index 08e3222..48690b3 100644 --- a/tests/index.php +++ b/tests/index.php @@ -825,7 +825,14 @@ function showDebugData(\Delight\Auth\Auth $auth, $result) { \var_dump($auth->isRemembered()); echo '$auth->getIpAddress()' . "\t\t\t"; \var_dump($auth->getIpAddress()); - echo "\n"; + echo 'Waiting for 2FA' . "\t\t\t\t"; + if (!empty($_SESSION[\Delight\Auth\Auth::SESSION_FIELD_AWAITING_2FA_UNTIL]) && $_SESSION[\Delight\Auth\Auth::SESSION_FIELD_AWAITING_2FA_UNTIL] >= \time()) { + echo 'User #' . ((int) $_SESSION[\Delight\Auth\Auth::SESSION_FIELD_AWAITING_2FA_USER_ID]) . ' (' . ($_SESSION[\Delight\Auth\Auth::SESSION_FIELD_AWAITING_2FA_UNTIL] - \time()) . ' seconds)'; + } + else { + echo 'No'; + } + echo "\n\n"; echo 'Session name' . "\t\t\t\t"; \var_dump(\session_name());