feat(caldav): reject basic auth for bot users

This commit is contained in:
kolaente 2026-04-05 19:55:50 +02:00 committed by kolaente
parent 8d3ac47605
commit 2e6bcec72a
1 changed files with 8 additions and 0 deletions

View File

@ -65,6 +65,10 @@ func BasicAuth(c *echo.Context, username, password string) (bool, error) {
return false, nil
}
if u != nil {
if u.IsBot() {
log.Warningf("CalDAV auth rejected for bot user %d", u.ID)
return false, nil
}
c.Set("userBasicAuth", u)
return true, nil
}
@ -103,6 +107,10 @@ func BasicAuth(c *echo.Context, username, password string) (bool, error) {
}
}
if u != nil && err == nil {
if u.IsBot() {
log.Warningf("CalDAV basic auth rejected for bot user %d", u.ID)
return false, nil
}
c.Set("userBasicAuth", u)
return true, nil
}