ag-awsauth 0.0.247 → 0.0.248
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.
- package/dist/helpers/browser.js +23 -16
- package/package.json +1 -1
package/dist/helpers/browser.js
CHANGED
|
@@ -157,24 +157,31 @@ function getMFA(p) {
|
|
|
157
157
|
retry = false;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
try {
|
|
161
|
+
(0, log_1.info)('wait for access prompt');
|
|
162
|
+
const messageDiv = yield page.waitForSelector('[data-testid="allow-access-button"]', {
|
|
163
|
+
timeout: config_1.timeoutShortMs,
|
|
164
|
+
});
|
|
165
|
+
if (messageDiv) {
|
|
166
|
+
(0, log_1.info)('click access prompt');
|
|
167
|
+
yield messageDiv.click();
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
throw new Error('access prompt not found');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
const em = e.toString();
|
|
175
|
+
if (!em.includes('exceeded')) {
|
|
176
|
+
const em2 = `mfa error:` + em + ' retry';
|
|
177
|
+
(0, log_1.error)(em2);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
retry = false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
160
183
|
} while (retry);
|
|
161
184
|
//
|
|
162
|
-
yield (0, sleep_1.sleep)(config_1.timeoutShortMs);
|
|
163
|
-
yield page.waitForNetworkIdle({ idleTime: 250 });
|
|
164
|
-
(0, log_1.info)('waiting for sign in button');
|
|
165
|
-
yield page.waitForSelector('#cli_login_button', {
|
|
166
|
-
timeout: config_1.timeoutShortMs,
|
|
167
|
-
});
|
|
168
|
-
(0, log_1.info)('pressing sign in');
|
|
169
|
-
yield page.$eval('#cli_login_button', (el) => el.click());
|
|
170
|
-
(0, log_1.info)('waiting for completion');
|
|
171
|
-
yield (0, sleep_1.sleep)(250);
|
|
172
|
-
try {
|
|
173
|
-
yield page.waitForNetworkIdle({ idleTime: 250, timeout: config_1.timeoutShortMs });
|
|
174
|
-
}
|
|
175
|
-
catch (e) {
|
|
176
|
-
//
|
|
177
|
-
}
|
|
178
185
|
(0, log_1.info)('waiting for success');
|
|
179
186
|
yield page.waitForSelector('[data-analytics-alert="success"]', {
|
|
180
187
|
timeout: config_1.timeoutMs,
|