From e9666d6f7596dee84e525c50b1eaf8fe47963775 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Thu, 12 Dec 2024 19:13:45 +0000
Subject: [PATCH] adjust to changes of spomky otphp lib, fixes #4980

Closes #4980

Merge request studip/studip!3740
---
 lib/models/TFASecret.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/models/TFASecret.php b/lib/models/TFASecret.php
index a841d5cd56a..2b54dd94e1f 100644
--- a/lib/models/TFASecret.php
+++ b/lib/models/TFASecret.php
@@ -24,8 +24,8 @@ class TFASecret extends SimpleORMap
     // period of time with a larger window to accept them).
     const TYPES = [
         'email' => [
-            'window' => 60,
-            'period' => 5,
+            'window' => 10,
+            'period' => 30,
         ],
         'app' => [
             'window' => 1,
@@ -172,7 +172,7 @@ class TFASecret extends SimpleORMap
 
         $window = self::TYPES[$this->type]['window'];
         if ($allow_reuse) {
-            $window = 0;
+            $window = null;
         }
 
         if ($this->getTOTP()->verify($token, $timestamp, $window)) {
-- 
GitLab