allow logout if 2-factor auth is enforced

This commit is contained in:
Uwe Steinmann 2025-10-01 09:56:31 +02:00
parent 244d483cf4
commit 630399c3c8

View File

@ -144,7 +144,7 @@ if (!$user->isAdmin() && $origuser == null) {
* already on the page Setup2Factor.php and no user substiation has occured.
*/
if($settings->_enable2FactorAuthentication && $settings->_guestID != $user->getID() && $settings->_autoLoginUser != $user->getID() && $origuser == null && $user->getSecret() == '') {
if(basename($_SERVER['SCRIPT_NAME']) != 'out.Setup2Factor.php' && basename($_SERVER['SCRIPT_NAME']) != 'op.Setup2Factor.php') {
if(!in_array(basename($_SERVER['SCRIPT_NAME']), ['out.Setup2Factor.php', 'op.Setup2Factor.php', 'op.Logout.php'])) {
header("Location: ../out/out.Setup2Factor.php");
exit;
}