Open krapton opened 1 year ago
just Comment this line (incomingRoutes.Use(middleware.Authentication()) ) in userRouter file and remove the respective package, and then add the below lines in the same file
incomingRoutes.POST("/users/signup",controller.SignUp())
incomingRoutes.POST("/users/login",controller.Login())
and add this router.Use(middleware.Authentication()) in main.go,did make all those changes please have in main repo
finally post, { "Email":"admin@gmail.com", "First_name":"Admin", "Last_name":"Nowhere", "Password":"Pass@123", "User_type":"ADMIN", "Phone":"87867055852"
}
@umair-bijapure This seems to be not working as what you are suggesting is the remove the authentication from the selective endpoints and make it part on the whole file after combining the endpoints together or maybe your explanation is not upto the mark to resolve the issue.
There seems to be an issue where with recent versions of Gin, all endpoints get protected, even the
/api-1
and/api-2
endpoints.When running the code in the repo with
go run main.go
and testing with Postman:What am i missing?