This commit is contained in:
2021-11-17 23:44:20 +01:00
parent 7bf8db8050
commit e05bd1c743
4 changed files with 66 additions and 3 deletions

View File

@@ -27,10 +27,11 @@ func ValidateOAuthToken(c *gin.Context) {
}
tokenInfoCall := oauth2Service.Tokeninfo()
tokenInfoCall.IdToken(authorizationHeaderSplitted[1])
_, err = tokenInfoCall.Do()
token, err := tokenInfoCall.Do()
if err != nil {
utils.GetLogger().WithError(err).Error(err)
utils.JSONError(c.Writer, model.ErrBadRequestFormat)
return
}
c.Set("googleUserId", token.UserId)
}