Skip to content

Commit

Permalink
set auth middleware only if auth passwd is set
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Feb 11, 2024
1 parent b0129e9 commit d433e73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/webapi/webapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ func (s *Server) Run(ctx context.Context) error {

if s.AuthPasswd != "" {
log.Printf("[INFO] basic auth enabled for webapi server")
router.Use(rest.BasicAuthWithPrompt("tg-spam", s.AuthPasswd))
} else {
log.Printf("[WARN] basic auth disabled, access to webapi is not protected")
}
router.Use(rest.BasicAuthWithPrompt("tg-spam", s.AuthPasswd))

router = s.routes(router) // setup routes

Expand Down

0 comments on commit d433e73

Please sign in to comment.