support proxy prefix

This commit is contained in:
sentriz
2020-01-27 17:00:23 +00:00
parent 6ad284aa3e
commit 2e85c95018
19 changed files with 401 additions and 361 deletions

View File

@@ -28,12 +28,12 @@ func (c *Controller) ServeLoginDo(w http.ResponseWriter, r *http.Request) {
// session and put the row into the request context
session.Values["user"] = user.Name
sessLogSave(session, w, r)
http.Redirect(w, r, "/admin/home", http.StatusSeeOther)
http.Redirect(w, r, c.Path("/admin/home"), http.StatusSeeOther)
}
func (c *Controller) ServeLogout(w http.ResponseWriter, r *http.Request) {
session := r.Context().Value(CtxSession).(*sessions.Session)
session.Options.MaxAge = -1
sessLogSave(session, w, r)
http.Redirect(w, r, "/admin/login", http.StatusSeeOther)
http.Redirect(w, r, c.Path("/admin/login"), http.StatusSeeOther)
}