In replyUpdateUser (server/user.go, master at the time of writing):
if allCreds, err := store.Users.GetAllCreds(uid, "", true); err != nil {
var validated []string
for i := range allCreds {
validated = append(validated, allCreds[i].Method)
}
_, missing, _ := stringSliceDelta(globals.authValidators[authLvl], validated)
if len(missing) > 0 {
params = map[string]any{"cred": missing}
}
}
The condition is err != nil, so the body — which builds the list of credentials the account still lacks — runs only when GetAllCreds failed, and then over an empty allCreds. On the path that works nothing runs, params stays nil, and the {ctrl} answering a successful {acc cred:[...]} never carries cred.
Expected: err == nil, so the reply tells the client which required validators are still unconfirmed (the same list replyCreateUser returns after registration).
Reproduced with a unit test around Session.dispatch using the gomock store: with one validated tel credential and auth_validators requiring tel and email, the reply's params.cred is nil; with the condition flipped it is ["email"].
In
replyUpdateUser(server/user.go, master at the time of writing):The condition is
err != nil, so the body — which builds the list of credentials the account still lacks — runs only whenGetAllCredsfailed, and then over an emptyallCreds. On the path that works nothing runs,paramsstays nil, and the{ctrl}answering a successful{acc cred:[...]}never carriescred.Expected:
err == nil, so the reply tells the client which required validators are still unconfirmed (the same listreplyCreateUserreturns after registration).Reproduced with a unit test around
Session.dispatchusing the gomock store: with one validatedtelcredential andauth_validatorsrequiringtelandemail, the reply'sparams.credisnil; with the condition flipped it is["email"].