-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(backend): get user by id #68
Conversation
backend/app/auth/routers.go
Outdated
@@ -39,4 +39,5 @@ func AuthRouter() { | |||
|
|||
router.GET("/auth", authHandler(*oauthConf)) | |||
router.POST("/auth", githubCallbackHandler(*oauthConf)) | |||
router.GET("/user/:userID", getUserByIdHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
router.GET("/user/:userID", getUserByIdHandler) | |
router.GET("/users/:userID", getUserByIdHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the docs
backend/app/auth/handlers.go
Outdated
@@ -55,6 +84,7 @@ func githubCallbackHandler(oauthConf oauth2.Config) gin.HandlerFunc { | |||
return gin.HandlerFunc(fn) | |||
} | |||
|
|||
// authHandler will return the url to the clien with the githubClientID for him to logIN |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// authHandler will return the url to the clien with the githubClientID for him to logIN | |
// authHandler will return the url to the client with the githubClientID for him to logIN |
LGTM. Thanks @Sanix-Darker |
Why ?
We need to get an user by it's ID
How ?
Steps to verify:
Just by running :
curl http://127.0.0.1:9999/api/user/:userID
after creating a user, the userID is the ID of that user !Screenshots (optional):