mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-13 09:55:36 +00:00
move authmiddleware to auth package
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user