support proxy prefix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user