Skip to content

Commit

Permalink
Fixed issue with usermap
Browse files Browse the repository at this point in the history
  • Loading branch information
reneManqueros committed May 26, 2023
1 parent d248b59 commit 4b6441f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions models/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
2 changes: 1 addition & 1 deletion models/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 4b6441f

Please sign in to comment.