diff --git a/httpd/api_utils.go b/httpd/api_utils.go index c5edfead..f7d442cb 100644 --- a/httpd/api_utils.go +++ b/httpd/api_utils.go @@ -370,7 +370,7 @@ func parseRangeRequest(bytesRange string, size int64) (int64, int64, error) { func updateLoginMetrics(user *dataprovider.User, ip string, err error) { metric.AddLoginAttempt(dataprovider.LoginMethodPassword) - if err != nil && err != common.ErrInternalFailure { + if err != nil && err != common.ErrInternalFailure && err != common.ErrNoCredentials { logger.ConnectionFailedLog(user.Username, ip, dataprovider.LoginMethodPassword, common.ProtocolHTTP, err.Error()) event := common.HostEventLoginFailed if _, ok := err.(*util.RecordNotFoundError); ok { diff --git a/webdavd/server.go b/webdavd/server.go index 7bd620eb..b2628586 100644 --- a/webdavd/server.go +++ b/webdavd/server.go @@ -368,7 +368,7 @@ func writeLog(r *http.Request, err error) { func updateLoginMetrics(user *dataprovider.User, ip, loginMethod string, err error) { metric.AddLoginAttempt(loginMethod) - if err != nil && err != common.ErrInternalFailure { + if err != nil && err != common.ErrInternalFailure && err != common.ErrNoCredentials { logger.ConnectionFailedLog(user.Username, ip, loginMethod, common.ProtocolWebDAV, err.Error()) event := common.HostEventLoginFailed if _, ok := err.(*util.RecordNotFoundError); ok {