Added page protection for unauthorized access

This commit is contained in:
2025-02-14 19:51:40 +11:00
parent 5616b8a248
commit ea4dd2a407
8 changed files with 107 additions and 15 deletions

View File

@@ -12,7 +12,11 @@ func HandleRoot() http.Handler {
return http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
page.Error("404", "Page not found", "The page or resource you have requested does not exist").Render(r.Context(), w)
page.Error(
"404",
"Page not found",
"The page or resource you have requested does not exist",
).Render(r.Context(), w)
return
}
page.Index().Render(r.Context(), w)