diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 8e0ac580..b81bf34f 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -1560,7 +1560,7 @@ function unset_tfa_key($_data) { } function get_tfa($username = null, $id = null) { global $pdo; - if (isset($_SESSION['mailcow_cc_username'])) { + if (empty($username) && isset($_SESSION['mailcow_cc_username'])) { $username = $_SESSION['mailcow_cc_username']; } elseif (empty($username)) {