diff -u b/src/EventSubscriber/ForceTfaSetup.php b/src/EventSubscriber/ForceTfaSetup.php --- b/src/EventSubscriber/ForceTfaSetup.php +++ b/src/EventSubscriber/ForceTfaSetup.php @@ -112,6 +112,10 @@ return; } + if ($is_tfa_setup_last_chance && $this->routeMatch->getRouteName() === 'user.logout') { + return; + } + if ($is_tfa_setup_last_chance && strpos($this->routeMatch->getRouteName(), 'tfa.') === 0) { $this->messenger->addError(t('You need to enable Two Factor Authentication now or your account will be blocked.')); return;