Fix open-redirect via next parameter, remove dead code

This commit is contained in:
2026-08-22 23:45:39 -05:00
parent b4b1ba8470
commit 89e46bf539
4 changed files with 13 additions and 16 deletions
+1 -4
View File
@@ -47,10 +47,7 @@ func (h *Web) handleLogin(w http.ResponseWriter, r *http.Request) {
}
_ = database.TouchLastLogin(h.DB, user.ID)
if next == "" || next[0] != '/' {
next = "/"
}
http.Redirect(w, r, next, http.StatusFound)
http.Redirect(w, r, safeRedirectPath(next), http.StatusFound)
}
func (h *Web) loginFailed(w http.ResponseWriter, r *http.Request, next string) {