1
0
mirror of https://github.com/vwxyzjn/portwarden synced 2025-12-31 14:23:13 +00:00

API-6 # Save work

This commit is contained in:
Costa Huang
2018-11-29 14:46:01 -05:00
parent 2e01ec7746
commit 4542745118
8 changed files with 133 additions and 78 deletions

View File

@@ -51,14 +51,13 @@ func (ps *PortwardenServer) GetGoogleDriveLoginHandler(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": ErrRetrievingOauthCode})
return
}
spew.Dump(tok)
GoogleDriveClient := ps.GoogleDriveAppConfig.Client(oauth2.NoContext, tok)
// fileBytes := []byte("xixix")
err = GetUserInfo(GoogleDriveClient, tok)
// pu := &PortwardenUser{GoogleToken: tok}
body, err := GetUserInfo(tok)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": ErrRetrievingOauthCode})
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": ""})
return
}
spew.Dump(string(body))
c.JSON(200, "Login Successful")
return
}