Move web UI from /ui/ to /web/ path prefix
The web UI is now mounted at /web/ (previously /ui/) — cmd/server/main.go
wraps web.Server.Handler with http.StripPrefix("/web", ...), so
internal/web's own routes stay unprefixed (/, /login, /logout,
/shares/..., /static/...) and only the outer mux adds the prefix. All
templates, redirects, and cookie paths updated accordingly. The root '/'
route reverts to the original unauthenticated welcome page (linking to
/web/), and /cal/, /card/, /files/ are unaffected.
Also gitignore the bin/ build output directory.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -26,13 +26,13 @@ func (s *Server) requireLogin(next http.HandlerFunc) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
cookie, err := r.Cookie(sessionCookieName)
|
||||
if err != nil {
|
||||
http.Redirect(w, r, "/ui/login", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/web/login", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
username, err := s.dbase.SessionUser(cookie.Value)
|
||||
if err != nil {
|
||||
s.clearSessionCookie(w)
|
||||
http.Redirect(w, r, "/ui/login", http.StatusSeeOther)
|
||||
http.Redirect(w, r, "/web/login", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
ctx := context.WithValue(r.Context(), userCtxKey, username)
|
||||
|
||||
Reference in New Issue
Block a user