Skip to content

Commit

Permalink
Remove unneeded context in log calls
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jul 19, 2020
1 parent f0160f5 commit 482f46f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/app/app.go
Expand Up @@ -38,13 +38,13 @@ func (app *Router) routes(path string) http.Handler {
r := chi.NewRouter()

if conf.Server.AuthRequestLimit > 0 {
log.Info(context.TODO(), "Login rate limit set", "requestLimit", conf.Server.AuthRequestLimit,
log.Info("Login rate limit set", "requestLimit", conf.Server.AuthRequestLimit,
"windowLength", conf.Server.AuthWindowLength)
rateLimiter := httprate.LimitByIP(conf.Server.AuthRequestLimit, conf.Server.AuthWindowLength)

rateLimiter := httprate.LimitByIP(conf.Server.AuthRequestLimit, conf.Server.AuthWindowLength)
r.With(rateLimiter).Post("/login", Login(app.ds))
} else {
log.Warn(context.TODO(), "Login rate limit is disabled! Consider enabling it to be protected against brute-force attacks")
log.Warn("Login rate limit is disabled! Consider enabling it to be protected against brute-force attacks")

r.Post("/login", Login(app.ds))
}
Expand Down

0 comments on commit 482f46f

Please sign in to comment.