From 41b07a04968891fee0331a787b17a72677571501 Mon Sep 17 00:00:00 2001 From: Aryan Singh Date: Tue, 9 Jan 2024 06:03:12 +0530 Subject: [PATCH] Adds middleware for Admin routes --- api/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/main.go b/api/main.go index 8ce13cc..9040c7e 100644 --- a/api/main.go +++ b/api/main.go @@ -36,11 +36,11 @@ func Start() { r.GET("/mfa", HandleGetMFAFlow) r.POST("/mfa", HandlePostMFAFlow) - r.POST("/create-identity", HandleCreateIdentityFlow) - r.GET("/get-identity", HandleGetIdentityFlow) - r.POST("/delete-identity", HandleDeleteIdentityFlow) - r.GET("/list-identity", HandleListIdentity) - r.PUT("/update-identity/ban", HandleBanIdentity) + r.POST("/create-identity", middleware.OnlyAdmin, HandleCreateIdentityFlow) + r.GET("/get-identity", middleware.OnlyAdmin, HandleGetIdentityFlow) + r.POST("/delete-identity", middleware.OnlyAdmin, HandleDeleteIdentityFlow) + r.GET("/list-identity", middleware.OnlyAdmin, HandleListIdentity) + r.PUT("/update-identity/ban", middleware.OnlyAdmin, HandleBanIdentity) r.GET("/register", HandleGetRegistrationFlow) r.POST("/register", HandlePostRegistrationFlow)