From 4b6441f25747e0c9359d6cd289ea45da284856c0 Mon Sep 17 00:00:00 2001 From: Rene Date: Fri, 26 May 2023 16:03:44 -0600 Subject: [PATCH] Fixed issue with usermap --- models/authentication.go | 4 ++-- models/server.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/authentication.go b/models/authentication.go index 226f0f4..ebd2e8d 100644 --- a/models/authentication.go +++ b/models/authentication.go @@ -13,12 +13,12 @@ var UserMap map[string]string func (u Users) Load(filename string) { data, err := os.ReadFile(filename) if err != nil { - log.Fatal().Err(err).Str("filename", filename).Msg("Users.Load") + log.Debug().Err(err).Str("filename", filename).Msg("Users.Load") return } err = yaml.Unmarshal(data, &UserMap) if err != nil { - log.Fatal().Err(err).Str("filename", filename).Msg("Users.Load.Unmarshall") + log.Info().Err(err).Str("filename", filename).Msg("Users.Load.Unmarshall") } } diff --git a/models/server.go b/models/server.go index 28b8fd9..22d6bf7 100644 --- a/models/server.go +++ b/models/server.go @@ -123,7 +123,7 @@ func (p *Proxy) handleRequest(responseWriter http.ResponseWriter, request *http. requestContext := RequestContext{} passedAuthentication := false - if p.Username == "" && p.Password == "" { + if len(UserMap) == 0 { passedAuthentication = true }