github-actions[bot]
commited on
Commit
·
4eaabd4
1
Parent(s):
637d7ae
Update from GitHub Actions
Browse files- functions/api/mail/auth.ts +10 -2
functions/api/mail/auth.ts
CHANGED
@@ -80,6 +80,14 @@ export const onRequest = async (context: RouteContext): Promise<Response> => {
|
|
80 |
await page.click('button[type="submit"]');
|
81 |
|
82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
for (let i = 0; i < 2; i++) {
|
84 |
try {
|
85 |
await page.waitForURL('https://account.live.com/identity/**', { timeout: 5000 });
|
@@ -113,7 +121,7 @@ export const onRequest = async (context: RouteContext): Promise<Response> => {
|
|
113 |
|
114 |
const suffix = proofEmail.substring(proofEmail.indexOf('@') + 1);
|
115 |
const proofConfig = proof.find(p => p.suffix === suffix)!;
|
116 |
-
console.log(suffix,proofConfig)
|
117 |
const verificationCode = await getVerificationCode(proofConfig.apiUrl, proofConfig.token!, account.proofEmail, timestamp);
|
118 |
console.log(`verificationCode:${verificationCode}`)
|
119 |
await page.fill('input[type="tel"]', verificationCode);
|
@@ -125,7 +133,7 @@ export const onRequest = async (context: RouteContext): Promise<Response> => {
|
|
125 |
|
126 |
|
127 |
//确认登录
|
128 |
-
await page.waitForURL('https://login.live.com
|
129 |
await page.click('button[type="submit"]#acceptButton'); // 同意按钮
|
130 |
|
131 |
//同意授权
|
|
|
80 |
await page.click('button[type="submit"]');
|
81 |
|
82 |
|
83 |
+
try {
|
84 |
+
await page.waitForURL("https://account.live.com/recover/**", { timeout: 5000 })
|
85 |
+
await page.click('#iLandingViewAction');
|
86 |
+
} catch (error) {
|
87 |
+
// 如果超时或页面未出现,直接继续执行
|
88 |
+
console.log("验证确定 page not found or timeout, skipping...");
|
89 |
+
}
|
90 |
+
|
91 |
for (let i = 0; i < 2; i++) {
|
92 |
try {
|
93 |
await page.waitForURL('https://account.live.com/identity/**', { timeout: 5000 });
|
|
|
121 |
|
122 |
const suffix = proofEmail.substring(proofEmail.indexOf('@') + 1);
|
123 |
const proofConfig = proof.find(p => p.suffix === suffix)!;
|
124 |
+
console.log(suffix, proofConfig)
|
125 |
const verificationCode = await getVerificationCode(proofConfig.apiUrl, proofConfig.token!, account.proofEmail, timestamp);
|
126 |
console.log(`verificationCode:${verificationCode}`)
|
127 |
await page.fill('input[type="tel"]', verificationCode);
|
|
|
133 |
|
134 |
|
135 |
//确认登录
|
136 |
+
await page.waitForURL('https://login.live.com/**')
|
137 |
await page.click('button[type="submit"]#acceptButton'); // 同意按钮
|
138 |
|
139 |
//同意授权
|