@sovovs/bycli 2.1.9 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -96,20 +96,24 @@ export async function resolveBrowserCredentials(page, options = {}) {
|
|
|
96
96
|
let state = await readPreflight(page);
|
|
97
97
|
|
|
98
98
|
if (!isLoggedInPreflight(state)) {
|
|
99
|
-
if (!page.focusWindow) {
|
|
100
|
-
throw new BrowserConnectError(
|
|
101
|
-
'The connected browser cannot be focused for WeChat login',
|
|
102
|
-
'Upgrade to byCLI 2.1 or newer to support interactive browser login',
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
99
|
await page.goto(LOGIN_URL);
|
|
107
|
-
await page
|
|
100
|
+
state = await readPreflight(page);
|
|
108
101
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
if (!isLoggedInPreflight(state)) {
|
|
103
|
+
if (!page.focusWindow) {
|
|
104
|
+
throw new BrowserConnectError(
|
|
105
|
+
'The connected browser cannot be focused for WeChat login',
|
|
106
|
+
'Upgrade to byCLI 2.1 or newer to support interactive browser login',
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
await page.focusWindow();
|
|
111
|
+
|
|
112
|
+
throw new AuthRequiredError(
|
|
113
|
+
DOMAIN,
|
|
114
|
+
'WeChat login is required. The login tab is open; complete QR-code login and run the command again.',
|
|
115
|
+
);
|
|
116
|
+
}
|
|
113
117
|
}
|
|
114
118
|
|
|
115
119
|
const finalUrl = state.url;
|