aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-09-03 15:00:03 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-09-03 15:00:03 +0530
commit95dfc551f7eaaf6e8ebdefce1b733951354ac40d (patch)
treeecabef39a94084c456eaf32bb508d8809d592c9f /main.go
parentfc83df70b787e447bf31f4d99fa723c7e38544f2 (diff)
added JWT authorization middleware
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 7 insertions, 2 deletions
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"))