feat(caldav): reject basic auth for bot users
This commit is contained in:
parent
8d3ac47605
commit
2e6bcec72a
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue