Add more v2 tests + fixes + improve legacy config parsing

This commit is contained in:
Thom Seddon
2019-04-18 15:07:39 +01:00
parent 5597b7268b
commit 6968f6181b
13 changed files with 538 additions and 407 deletions

View File

@ -38,7 +38,11 @@ func (s *Server) buildRoutes() {
s.router.Handle(config.Path, s.AuthCallbackHandler())
// Add a default handler
s.router.NewRoute().Handler(s.AuthHandler())
if config.DefaultAction == "allow" {
s.router.NewRoute().Handler(s.AllowHandler())
} else {
s.router.NewRoute().Handler(s.AuthHandler())
}
}
func (s *Server) RootHandler(w http.ResponseWriter, r *http.Request) {