From 1bae7f13d499a153a7931ea8fff154fa34abc45c Mon Sep 17 00:00:00 2001 From: Adam Vollrath Date: Mon, 11 Mar 2024 22:47:11 -0500 Subject: [PATCH] Authenticate requests for individual todos like other requests. --- controllers/todoController.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controllers/todoController.go b/controllers/todoController.go index ae01572..e6d10ec 100644 --- a/controllers/todoController.go +++ b/controllers/todoController.go @@ -18,6 +18,11 @@ import ( var todoCollection *mongo.Collection = database.OpenCollection(database.Client, "todos") func GetTodo(c *gin.Context) { + session := auth.ValidateSession(c) + if !session{ + return + } + var ctx, cancel = context.WithTimeout(context.Background(), 100*time.Second) id := c.Param("id")