1
0
mirror of https://github.com/vwxyzjn/portwarden synced 2025-12-23 02:53:12 +00:00

API-6 # Use Google API to get user info

This commit is contained in:
Costa Huang
2018-11-29 10:39:10 -05:00
parent 10d1bfe3f0
commit 5bfedbf3cc
4 changed files with 51 additions and 4 deletions

View File

@@ -53,8 +53,8 @@ func (ps *PortwardenServer) GetGoogleDriveLoginHandler(c *gin.Context) {
}
spew.Dump(tok)
GoogleDriveClient := ps.GoogleDriveAppConfig.Client(oauth2.NoContext, tok)
fileBytes := []byte("xixix")
err = UploadFile(fileBytes, GoogleDriveClient, tok)
// fileBytes := []byte("xixix")
err = GetUserInfo(GoogleDriveClient, tok)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": ErrRetrievingOauthCode})
return