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:
@@ -174,7 +174,11 @@ func main() {
|
||||
|
||||
// Home / create event
|
||||
r.Get("/", srv.handleHome)
|
||||
r.Post("/events", srv.handleCreateEvent)
|
||||
if features.Auth {
|
||||
r.With(srv.requireAuth).Post("/events", srv.handleCreateEvent)
|
||||
} else {
|
||||
r.Post("/events", srv.handleCreateEvent)
|
||||
}
|
||||
|
||||
// Guest event view
|
||||
r.Get("/e/{slug}", srv.handleEvent)
|
||||
|
||||
Reference in New Issue
Block a user