eefef2eb17
The Update method of the usersDB takes a console.User as an argument. To update the columns in the DB, we have to migrate the fields from the console.Users struct into a special dbx struct. If one of these fields is left empty, then the zero value of that field's type will be used to update the respective column. In most cases where the users.Update method is called, the entire console.User is apparently retrieved first, fields are updated, then it is passed to users.Update. This is not the case for service.UpdateAccount. Because these fields are not populated in the user struct in UpdateAccount before it is passed into users.Update, their respective columns in the database are overwritten with zero: ProjectLimit, ProjectStorageLimit, ProjectBandwidthLimit, ProjectSegmentLimit, PaidTier, MfaEnabled, MfaRecoveryCodes, MfaSecretKey Solution: Do what is done in other places which call users.Update. Take the console.User from the auth context, update the relevant fields on that, then pass that in. Change-Id: I3cbd560e8ea5397e5c27711fb40bb3907d987028 |
||
---|---|---|
.. | ||
consoleauth | ||
consolewasm | ||
consoleweb | ||
wasm | ||
apikeys_test.go | ||
apikeys.go | ||
attribution_test.go | ||
auth.go | ||
billinghistoryitem.go | ||
buckets.go | ||
database.go | ||
mfa.go | ||
projectmembers_test.go | ||
projectmembers.go | ||
projects_test.go | ||
projects.go | ||
projectusagelimits.go | ||
recaptcha_test.go | ||
recaptcha.go | ||
registrationtoken.go | ||
request.go | ||
resetpasswordtoken_test.go | ||
resetpasswordtoken.go | ||
service_test.go | ||
service.go | ||
sortdirection.go | ||
users_test.go | ||
users.go | ||
validation.go |