wip
This commit is contained in:
@@ -14,8 +14,6 @@ import (
|
||||
"google.golang.org/api/oauth2/v2"
|
||||
)
|
||||
|
||||
var httpClient = &http.Client{}
|
||||
|
||||
func (hc *handlersContext) getAllUsers(c *gin.Context) {
|
||||
users, err := hc.db.GetAllUsers()
|
||||
if err != nil {
|
||||
@@ -34,7 +32,12 @@ func (hc *handlersContext) connectUser(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
oauth2Service, err := oauth2.New(httpClient)
|
||||
oauth2Service, err := oauth2.New(&http.Client{})
|
||||
if oauth2Service == nil {
|
||||
fmt.Println(err)
|
||||
utils.JSONError(c.Writer, model.ErrInternalServer)
|
||||
return
|
||||
}
|
||||
tokenInfoCall := oauth2Service.Tokeninfo()
|
||||
tokenInfoCall.IdToken(authorizationHeaderSplitted[1])
|
||||
tokenInfo, err := tokenInfoCall.Do()
|
||||
@@ -63,7 +66,8 @@ func (hc *handlersContext) connectUser(c *gin.Context) {
|
||||
utils.JSONError(c.Writer, model.ErrInternalServer)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("Found the user " + user.Nickname)
|
||||
fmt.Println("Return 200")
|
||||
utils.JSON(c.Writer, 200, user)
|
||||
}
|
||||
func (hc *handlersContext) createUser(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user