From dd968fefed6113e37fc0b469a50ae56c8cb47dd4 Mon Sep 17 00:00:00 2001 From: fchrgrib <16521492@mahasiswa.itb.ac.id> Date: Thu, 15 Jun 2023 15:12:29 +0700 Subject: [PATCH] Update AuthwithToken 1.12 --- handlers/routers/Profile.go | 3 +-- handlers/routers/WallpaperPage.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/handlers/routers/Profile.go b/handlers/routers/Profile.go index 1f5712a..45156c5 100644 --- a/handlers/routers/Profile.go +++ b/handlers/routers/Profile.go @@ -14,8 +14,7 @@ func Profile(routers *gin.Engine) { profileRouter.GET("", profile.Info) profileRouter.PUT("/update_profile_desc", profile.UpdateProfileDescription) - rProfile := routers.Group("photo_profile") - rProfile.Use(middleware.AuthWithToken) + rProfile := privateRouters.Group("photo_profile") profileRouter.PUT("/update_profile_picture", func(c *gin.Context) { profile.UpdatePhotoProfile(c, rProfile) diff --git a/handlers/routers/WallpaperPage.go b/handlers/routers/WallpaperPage.go index 2ab57db..da04c91 100644 --- a/handlers/routers/WallpaperPage.go +++ b/handlers/routers/WallpaperPage.go @@ -11,8 +11,7 @@ func WallpaperPage(routers *gin.Engine) { privateRouters.Use(middleware.JWT) privateRouters.GET("", wallpaperpage.WallpaperCollection) - rImage := routers.Group("/images") - rImage.Use(middleware.JWT) + rImage := privateRouters.Group("/images") privateRouters.POST("/upload", func(c *gin.Context) { wallpaperpage.UploadWallpaper(c, rImage) })