1
0
mirror of https://github.com/vwxyzjn/portwarden synced 2025-12-28 04:43:14 +00:00

API-6 # Get user info also gets user's email address

This commit is contained in:
Costa Huang
2018-12-01 01:01:18 -05:00
parent 4542745118
commit 3ed816cbe7
3 changed files with 11 additions and 4 deletions

View File

@@ -46,9 +46,9 @@ func (ps *PortwardenServer) GetGoogleDriveLoginHandler(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": ErrRetrievingOauthCode})
return
}
tok, err := ps.GoogleDriveAppConfig.Exchange(ps.GoogleDriveContext, gdc.Code)
tok, err := GoogleDriveAppConfig.Exchange(oauth2.NoContext, gdc.Code)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error(), "message": ErrRetrievingOauthCode})
c.JSON(http.StatusUnauthorized, gin.H{"error": err.Error(), "message": "Login failure"})
return
}
// pu := &PortwardenUser{GoogleToken: tok}