Skip to content

Commit

Permalink
fix removing recovery phone/email fields
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Mar 1, 2021
1 parent 8482ac7 commit b69f99b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/glib/directory_users.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func (ds *DirectoryService) DeleteUser(ctx context.Context, user *directoryv1.Us
}

func (ds *DirectoryService) UpdateUser(ctx context.Context, oldUser *directoryv1.User, newUser *directoryv1.User) (*directoryv1.User, error) {
// google.golang.org/api v0.40.0 cannot by default handle removing recovery phone/email
// fields, see https://github.com/googleapis/google-api-go-client/issues/901
newUser.ForceSendFields = []string{"RecoveryEmail", "RecoveryPhone"}

updatedUser, err := ds.Users.Update(oldUser.PrimaryEmail, newUser).Context(ctx).Do()
if err != nil {
return nil, err
Expand Down

0 comments on commit b69f99b

Please sign in to comment.