From c365d940819449fbdddc1710f7a58a9ca3a5d93a Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 15 May 2018 15:47:13 +0200 Subject: [PATCH] =?UTF-8?q?API=20-=20Se=20=C3=A8=20in=20corso=20un=20brute?= =?UTF-8?q?-force,=20aggiunge=20il=20timeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/index.php b/api/index.php index 8948e0e5a..005f175a1 100644 --- a/api/index.php +++ b/api/index.php @@ -64,10 +64,13 @@ try { } catch (InvalidArgumentException $e) { if (Auth::getInstance()->attempt(post('username'), post('password'))) { - $token = Auth::getInstance()->getToken(); - $result = $token; + $result = Auth::getInstance()->getToken(); }else{ $result = API::error('unauthorized'); + // Se รจ in corso un brute-force, aggiunge il timeout + if (Auth::isBrute()) { + $result = Auth::getBruteTimeout(); + } } } catch (Exception $e) {