add authAdminMiddlware into package auth. Need test it

This commit is contained in:
valitovgaziz
2024-08-23 07:53:10 +05:00
parent 3b045c8629
commit d10f4af8e3
6 changed files with 61 additions and 12 deletions
+5 -1
View File
@@ -50,7 +50,11 @@ func InitChiRouting() {
r.Group(func(r chi.Router) {
r.Use(auth.AuthMiddleware)
r.Get("/profile", prf.Profile)
r.Get("/allUsers", admin.GetAllUser) // all users get
r.Get("/allUsersAdm", admin.GetAllUser)
r.Route("/admin", func(r chi.Router) {
r.Use(auth.AuthAdminMiddleware)
r.Get("/allUsersAdm", admin.GetAllUser) // all users get
})
})
// up server on os.Getenv("SERVER_PORT") port on gorutin