dh-remixer-sdk 0.0.36 → 0.0.37-0df23bc
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/package.json
CHANGED
|
@@ -334,6 +334,28 @@ export class Prerenderer {
|
|
|
334
334
|
// can't parse it when spawned directly — and use a clean headless flag.
|
|
335
335
|
const args = chromium.args.filter((a) => !a.startsWith("--headless"));
|
|
336
336
|
args.push("--headless=new");
|
|
337
|
+
// Ads/analytics are never part of the prerendered SEO HTML, and their
|
|
338
|
+
// iframes keep loading/beaconing so the page never reaches network-idle
|
|
339
|
+
// (AI-7017: ~15s idle-cap burned per page × N pages → 540s Lambda kill).
|
|
340
|
+
// They load in cross-origin (out-of-process) frames, so a top-level CDP
|
|
341
|
+
// Network.setBlockedURLs never sees them — fail their DNS browser-wide
|
|
342
|
+
// instead, which applies to every render process/frame. Ad requests then
|
|
343
|
+
// error instantly and each page reaches network-idle in <1s. Keep this to
|
|
344
|
+
// ad/tracking hosts only — do NOT block *.googleapis.com (Maps geocoding,
|
|
345
|
+
// Fonts) or the app's own APIs.
|
|
346
|
+
const AD_TRACKING_HOSTS = [
|
|
347
|
+
"*.googlesyndication.com",
|
|
348
|
+
"*.doubleclick.net",
|
|
349
|
+
"*.googleadservices.com",
|
|
350
|
+
"*.googletagservices.com",
|
|
351
|
+
"*.adtrafficquality.google",
|
|
352
|
+
"*.google-analytics.com",
|
|
353
|
+
"*.googletagmanager.com",
|
|
354
|
+
];
|
|
355
|
+
args.push(
|
|
356
|
+
"--host-resolver-rules=" +
|
|
357
|
+
AD_TRACKING_HOSTS.map((h) => `MAP ${h} ~NOTFOUND`).join(","),
|
|
358
|
+
);
|
|
337
359
|
args.push(
|
|
338
360
|
`--user-data-dir=/tmp/chrome-data-${debugPort}`,
|
|
339
361
|
`--remote-debugging-port=${debugPort}`,
|
|
@@ -15,8 +15,6 @@ async function brokerEmailAuth(path: 'signin' | 'signup', email: string, passwor
|
|
|
15
15
|
email,
|
|
16
16
|
password,
|
|
17
17
|
metadata,
|
|
18
|
-
// Land email-confirmation on /account so the generated Account page's
|
|
19
|
-
// exchange handler redeems the code — same return target as Google sign-in.
|
|
20
18
|
return_to: `${window.location.origin}/account`,
|
|
21
19
|
}),
|
|
22
20
|
});
|
|
@@ -83,6 +81,46 @@ export const auth = {
|
|
|
83
81
|
refresh_token: payload.refresh_token,
|
|
84
82
|
});
|
|
85
83
|
},
|
|
84
|
+
|
|
85
|
+
async resetPassword(email: string) {
|
|
86
|
+
const res = await fetch(`${getAuthBrokerBaseUrl()}/auth/email/reset`, {
|
|
87
|
+
method: 'POST',
|
|
88
|
+
headers: { 'Content-Type': 'application/json' },
|
|
89
|
+
body: JSON.stringify({
|
|
90
|
+
email,
|
|
91
|
+
return_to: `${window.location.origin}/reset-password`,
|
|
92
|
+
}),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (!res.ok) {
|
|
96
|
+
const body = await res.json().catch(() => ({}));
|
|
97
|
+
throw new Error(body.error || `Password reset failed (${res.status})`);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return res.json();
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
async updatePassword(newPassword: string) {
|
|
104
|
+
const session = await getProjectSession();
|
|
105
|
+
const accessToken = session?.access_token;
|
|
106
|
+
if (!accessToken) throw new Error('No active session to update password');
|
|
107
|
+
|
|
108
|
+
const res = await fetch(`${getAuthBrokerBaseUrl()}/auth/email/update-password`, {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
headers: {
|
|
111
|
+
'Content-Type': 'application/json',
|
|
112
|
+
Authorization: `Bearer ${accessToken}`,
|
|
113
|
+
},
|
|
114
|
+
body: JSON.stringify({ password: newPassword }),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (!res.ok) {
|
|
118
|
+
const body = await res.json().catch(() => ({}));
|
|
119
|
+
throw new Error(body.error || `Password update failed (${res.status})`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return res.json();
|
|
123
|
+
},
|
|
86
124
|
signOut() {
|
|
87
125
|
return supabase.auth.signOut();
|
|
88
126
|
},
|