// Google API does not indicate one.
func (ctrl *googleLoginController) getAuthInfo(ctx context.Context, cluster *arvados.Cluster, conf *oauth2.Config, token *oauth2.Token, idToken *oidc.IDToken) (*rpc.UserSessionAuthInfo, error) {
var ret rpc.UserSessionAuthInfo
- defer ctxlog.FromContext(ctx).Infof("ret: %#v", &ret) // debug
+ defer ctxlog.FromContext(ctx).WithField("ret", &ret).Debug("getAuthInfo returned")
var claims struct {
Name string `json:"name"`
// Override normal API endpoint (for testing)
svc.BasePath = p
}
- person, err := people.NewPeopleService(svc).Get("people/me").Fields("emailAddresses,names").Do()
+ person, err := people.NewPeopleService(svc).Get("people/me").PersonFields("emailAddresses,names").Do()
if err != nil {
if strings.Contains(err.Error(), "Error 403") && strings.Contains(err.Error(), "accessNotConfigured") {
// Log the original API error, but display
}
}
- ctxlog.FromContext(ctx).Infof("people/me response: %#v", person) // debug
-
// The given/family names returned by the People API and
// flagged as "primary" (if any) take precedence over the
// split-by-whitespace result from above.
}
for _, ea := range person.EmailAddresses {
if ea.Metadata == nil || !ea.Metadata.Verified {
- ctxlog.FromContext(ctx).WithField("address", ea.Value).Debug("skipping unverified email address")
+ ctxlog.FromContext(ctx).WithField("address", ea.Value).Info("skipping unverified email address")
continue
}
altEmails[ea.Value] = true