fix: reconnect to a passwordless server without a token

The stored connection remembers that no password was set, but the
reconnect path still required a device token and asked for the password.
Reconnect without one when the server issued none.
This commit is contained in:
blumia committed 2026-11-16 10:41:04 +08:00
1 parent 23f72fc46d
commit ef0b63ceee
2 files changed
+23 -5

No files matched your search

+13
View File
@@ -221,3 +221,16 @@ func TestPasswordlessServer(t *testing.T) {
t.Errorf("passwordless not remembered: %+v", got)
}
}
func TestAutoReconnectPasswordlessWithoutToken(t *testing.T) {
srv := fakeServer(t, "", "")
t.Cleanup(srv.Close)
st := &memStore{
conn: storage.Connection{URL: srv.URL, Passwordless: true},
has: true,
}
a := mount(t, st)
a.WaitFor("First session")
a.ExpectNo("请重新输入密码")
}