mcp-scraper 0.1.2 → 0.1.3
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/bin/api-server.js
CHANGED
|
@@ -17,7 +17,7 @@ loadDotEnv();
|
|
|
17
17
|
async function main() {
|
|
18
18
|
const [{ serve }, { app }, { startWorker }, { migrate }] = await Promise.all([
|
|
19
19
|
import("@hono/node-server"),
|
|
20
|
-
import("../server-
|
|
20
|
+
import("../server-6CHHLOII.js"),
|
|
21
21
|
import("../worker-D4D2YQTA.js"),
|
|
22
22
|
import("../db-YWCNHBLH.js")
|
|
23
23
|
]);
|
|
@@ -10887,19 +10887,15 @@ app.post("/auth/register", requireAllowedOrigin, async (c) => {
|
|
|
10887
10887
|
const normalizedEmail = email?.trim().toLowerCase();
|
|
10888
10888
|
if (!normalizedEmail || !password) return c.json({ error: "Email and password required" }, 400);
|
|
10889
10889
|
if (password.length < 8) return c.json({ error: "Password must be at least 8 characters" }, 400);
|
|
10890
|
-
const limited = await enforceRateLimit(c, "auth_register", rateLimitKey(c), 5, 60 * 60);
|
|
10891
|
-
if (limited) return limited;
|
|
10892
10890
|
try {
|
|
10893
10891
|
const existing = await getUserByEmail(normalizedEmail);
|
|
10894
10892
|
if (existing) return c.json({ error: "Email already registered" }, 409);
|
|
10895
|
-
let stripeCustomerId;
|
|
10893
|
+
let stripeCustomerId = null;
|
|
10896
10894
|
try {
|
|
10897
10895
|
stripeCustomerId = await createSignupStripeCustomer(normalizedEmail);
|
|
10898
|
-
} catch {
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
if (!stripeCustomerId && (process.env.NODE_ENV === "production" || process.env.VERCEL === "1")) {
|
|
10902
|
-
return c.json({ error: "Stripe customer setup failed" }, 503);
|
|
10896
|
+
} catch (err) {
|
|
10897
|
+
console.warn("[auth/register] Stripe customer creation failed; continuing without it (created lazily at checkout):", err instanceof Error ? err.message : String(err));
|
|
10898
|
+
stripeCustomerId = null;
|
|
10903
10899
|
}
|
|
10904
10900
|
const user = await createUser(normalizedEmail, void 0, password, stripeCustomerId ?? void 0);
|
|
10905
10901
|
if (stripeCustomerId) {
|
|
@@ -10960,14 +10956,18 @@ app.post("/auth/forgot-password", requireAllowedOrigin, async (c) => {
|
|
|
10960
10956
|
if (process.env.RESEND_API_KEY) {
|
|
10961
10957
|
try {
|
|
10962
10958
|
const resend = new Resend(process.env.RESEND_API_KEY);
|
|
10963
|
-
await resend.emails.send({
|
|
10959
|
+
const sent = await resend.emails.send({
|
|
10964
10960
|
from: "MCP Scraper <noreply@updates.mcpscraper.dev>",
|
|
10965
10961
|
to: normalizedEmail,
|
|
10966
10962
|
subject: "Reset your MCP Scraper password",
|
|
10967
10963
|
html: `<p>Hi,</p><p>Click the link below to reset your password. This link expires in 1 hour.</p><p><a href="${resetUrl}">${resetUrl}</a></p><p>If you didn't request this, you can ignore this email.</p>`
|
|
10968
10964
|
});
|
|
10969
|
-
|
|
10965
|
+
if (sent.error) console.error("[auth/forgot-password] Resend rejected the email:", JSON.stringify(sent.error));
|
|
10966
|
+
} catch (err) {
|
|
10967
|
+
console.error("[auth/forgot-password] Resend send threw:", err instanceof Error ? err.message : String(err));
|
|
10970
10968
|
}
|
|
10969
|
+
} else {
|
|
10970
|
+
console.warn("[auth/forgot-password] RESEND_API_KEY not set \u2014 no reset email sent for", normalizedEmail);
|
|
10971
10971
|
}
|
|
10972
10972
|
return c.json({ ok: true });
|
|
10973
10973
|
});
|
|
@@ -11622,4 +11622,4 @@ app.get("/blog/:slug/", (c) => {
|
|
|
11622
11622
|
export {
|
|
11623
11623
|
app
|
|
11624
11624
|
};
|
|
11625
|
-
//# sourceMappingURL=server-
|
|
11625
|
+
//# sourceMappingURL=server-6CHHLOII.js.map
|