From 95dfc551f7eaaf6e8ebdefce1b733951354ac40d Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 3 Sep 2023 15:00:03 +0530 Subject: added JWT authorization middleware --- main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index dfeec0c..6b9704c 100644 --- a/main.go +++ b/main.go @@ -51,8 +51,13 @@ func main() { { user.Routes(api) auth.Routes(api) - customer.Routes(api) - item.Routes(api) + } + + protected := api.Group("/") + protected.Use(auth.Authorize()) + { + customer.Routes(protected) + item.Routes(protected) } r.Run(":" + viper.GetString("port")) -- cgit v1.2.3