Auth CLI, continued

This commit is contained in:
Philipp Heckel 2022-01-23 23:02:39 -05:00
parent 03a4e3e8e9
commit 393f95aeac
6 changed files with 183 additions and 43 deletions

View file

@ -1134,7 +1134,7 @@ func (s *Server) withAuth(next handleFunc, perm auth.Permission) handleFunc {
if err != nil {
return err
}
user := auth.Everyone
var user *auth.User // may stay nil if no auth header!
username, password, ok := r.BasicAuth()
if ok {
if user, err = s.auth.Authenticate(username, password); err != nil {