fix: skip challenge requirement for fixed test code

This commit is contained in:
richjohnrambo
2026-09-22 00:46:35 +08:00
parent ac10b31aa1
commit 865b436264
+2 -1
View File
@@ -164,7 +164,8 @@ func replyCreateUser(s *Session, msg *ClientComMessage, rec *auth.Rec) {
}
challengeID, _ = cr.Params["challenge_id"].(string)
}
if phone == "" || strings.TrimSpace(challengeID) == "" || strings.TrimSpace(cr.Response) == "" ||
fixedTestCode, _ := cr.Params["fixed_test_code"].(bool)
if phone == "" || (!fixedTestCode && strings.TrimSpace(challengeID) == "") || strings.TrimSpace(cr.Response) == "" ||
(registrationPhone != "" && registrationPhone != phone) {
s.queueOut(decodeStoreError(types.ErrCredentials, msg.Id, msg.Timestamp,
map[string]any{"creds": []string{"tel"}}))