fix(support-chat): remove device verification prompt

This commit is contained in:
t
2026-08-30 11:42:05 +08:00
parent 18c9354095
commit 12c7060dbe
4 changed files with 28 additions and 189 deletions
+8 -7
View File
@@ -160,20 +160,20 @@ func TestSupportChatStagesUploadsUntilExplicitSend(t *testing.T) {
}
}
func TestSupportChatRequiresCurrentVerifiedNumberSession(t *testing.T) {
func TestSupportChatEstablishesNumberSessionWithoutVerificationDialog(t *testing.T) {
index, err := assets.ReadFile("assets/index.html")
if err != nil {
t.Fatalf("read support chat index: %v", err)
}
for _, marker := range []string{
for _, forbidden := range []string{
`id="access-overlay"`,
`id="access-password-tab"`,
`id="access-sms-tab"`,
`id="access-send-code"`,
`id="access-submit"`,
} {
if !strings.Contains(string(index), marker) {
t.Fatalf("support chat verification dialog does not contain %q", marker)
if strings.Contains(string(index), forbidden) {
t.Fatalf("support chat must not contain verification dialog marker %q", forbidden)
}
}
@@ -184,10 +184,7 @@ func TestSupportChatRequiresCurrentVerifiedNumberSession(t *testing.T) {
source := string(script)
for _, marker := range []string{
`new URLSearchParams(window.location.hash.replace(/^#/, ""))`,
`h5AccessRequest("/access/send-code"`,
`h5AccessRequest("/access/authorize"`,
`h5AccessRequest("/access/chat-entry"`,
`"X-H5-Access-Token": accessToken`,
`headers.set("X-H5-Chat-Session", "required")`,
`headers.set("X-H5-Chat-Binding", state.chatBinding)`,
`query.set("h5_chat_session", "required")`,
@@ -201,6 +198,10 @@ func TestSupportChatRequiresCurrentVerifiedNumberSession(t *testing.T) {
}
}
for _, forbidden := range []string{
`h5AccessRequest("/access/send-code"`,
`h5AccessRequest("/access/authorize"`,
`"X-H5-Access-Token": accessToken`,
`showAccessDialog(`,
`localStorage.setItem("h5_access_token"`,
`sessionStorage.setItem("h5_access_token"`,
} {