Require login to create events when auth is enabled
Gate the home page and POST /events behind auth. Also add sqlite3 CLI to the Docker image for DB inspection, and gitignore test.db files. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -49,6 +49,10 @@ func randomSlug() string {
|
||||
// --- Home / Create Event ---
|
||||
|
||||
func (s *Server) handleHome(w http.ResponseWriter, r *http.Request) {
|
||||
if s.features.Auth && s.currentUser(r) == nil {
|
||||
http.Redirect(w, r, "/login", http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
pageTmpl["home"].ExecuteTemplate(w, "layout", map[string]any{
|
||||
"User": s.currentUser(r),
|
||||
"AuthEnabled": s.features.Auth,
|
||||
|
||||
Reference in New Issue
Block a user