1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-08 11:25:20 +02:00

[v12.0/forgejo] chore: failed authentication attempts are not errors and are displayed at the log info level (#8526)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8524

I think those are not errors but simple info messages for admins.

I saw them a lot in my logs when no auth was passed to the api calls.

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8526
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2025-07-16 15:58:56 +02:00 committed by Earl Warren
parent 8a93a3e59c
commit 48920461a2
2 changed files with 2 additions and 2 deletions

View file

@ -117,7 +117,7 @@ func verifyAuth(r *web.Route, authMethods []auth.Method) {
var err error
ctx.Doer, err = authGroup.Verify(ctx.Req, ctx.Resp, ctx, ctx.Session)
if err != nil {
log.Error("Failed to verify user: %v", err)
log.Info("Failed to verify user: %v", err)
ctx.Error(http.StatusUnauthorized, "authGroup.Verify")
return
}

View file

@ -117,7 +117,7 @@ func webAuth(authMethod auth_service.Method) func(*context.Context) {
return func(ctx *context.Context) {
ar, err := common.AuthShared(ctx.Base, ctx.Session, authMethod)
if err != nil {
log.Error("Failed to verify user: %v", err)
log.Info("Failed to verify user: %v", err)
ctx.Error(http.StatusUnauthorized, ctx.Locale.TrString("auth.unauthorized_credentials", "https://codeberg.org/forgejo/forgejo/issues/2809"))
return
}