defender: allow to impose a delay between login attempts

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-05-17 20:48:18 +02:00
parent b2bea85add
commit 50a3c0d911
17 changed files with 174 additions and 82 deletions

View File

@@ -821,6 +821,7 @@ func (s *httpdServer) loginAdmin(
return
}
dataprovider.UpdateAdminLastLogin(admin)
common.DelayLogin(nil)
redirectURL := webUsersPath
if errorFunc == nil {
redirectURL = webAdminMFAPath
@@ -1000,6 +1001,7 @@ func (s *httpdServer) generateAndSendToken(w http.ResponseWriter, r *http.Reques
}
dataprovider.UpdateAdminLastLogin(&admin)
common.DelayLogin(nil)
render.JSON(w, r, resp)
}