basepath fixes

This commit is contained in:
Nazar Kanaev
2021-03-17 16:25:16 +00:00
parent 5e453e3227
commit f3c55ba5f2
4 changed files with 25 additions and 29 deletions

View File

@@ -21,10 +21,10 @@ func (s *Server) handler() http.Handler {
// TODO: auth, base, security
if s.Username != "" && s.Password != "" {
a := &authMiddleware{
basepath: BasePath,
username: s.Username,
password: s.Password,
basepath: BasePath + "/",
public: BasePath + "/static",
public: "/static",
}
r.Use(a.handler)
}
@@ -401,6 +401,6 @@ func (s *Server) handlePageCrawl(c *router.Context) {
}
func (s *Server) handleLogout(c *router.Context) {
auth.Logout(c.Out)
auth.Logout(c.Out, BasePath)
c.Out.WriteHeader(http.StatusNoContent)
}