Skip to content

Commit

Permalink
fix: admin paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jan 9, 2024
1 parent 46f26d8 commit d0a1854
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/middleware/auth/auth.middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (m *Guard) Use(ctx router.IContext) error {
if utils.IsExisted(m.adminpath, path) && payload.Role != string(user.ADMIN) {
ctx.JSON(http.StatusUnauthorized, dto.ResponseErr{
StatusCode: http.StatusUnauthorized,
Message: "Unauthorized",
Message: "Limited access",
Data: nil,
})
return nil
Expand Down
2 changes: 1 addition & 1 deletion src/constant/auth/auth.constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var ExcludePath = map[string]struct{}{
}

var AdminPath = map[string]struct{}{
"DELETE /users/:id": {},
"DELETE /user/:id": {},
"POST /pets": {},
"PUT /pets/:id": {},
"PUT /pets/:id/visible": {},
Expand Down

0 comments on commit d0a1854

Please sign in to comment.