move authmiddleware to auth package
This commit is contained in:
parent
0b1c90718d
commit
eb0ad7f22e
2 changed files with 18 additions and 20 deletions
|
|
@ -18,15 +18,14 @@ import (
|
|||
func (s *Server) handler() http.Handler {
|
||||
r := router.NewRouter(BasePath)
|
||||
|
||||
// TODO: auth, base, security
|
||||
if s.Username != "" && s.Password != "" {
|
||||
a := &authMiddleware{
|
||||
basepath: BasePath,
|
||||
username: s.Username,
|
||||
password: s.Password,
|
||||
public: "/static",
|
||||
a := &auth.Middleware{
|
||||
BasePath: BasePath,
|
||||
Username: s.Username,
|
||||
Password: s.Password,
|
||||
Public: "/static",
|
||||
}
|
||||
r.Use(a.handler)
|
||||
r.Use(a.Handler)
|
||||
}
|
||||
|
||||
r.For("/", s.handleIndex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue