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.cjs
CHANGED
|
@@ -16479,19 +16479,15 @@ var init_server = __esm({
|
|
|
16479
16479
|
const normalizedEmail = email?.trim().toLowerCase();
|
|
16480
16480
|
if (!normalizedEmail || !password) return c.json({ error: "Email and password required" }, 400);
|
|
16481
16481
|
if (password.length < 8) return c.json({ error: "Password must be at least 8 characters" }, 400);
|
|
16482
|
-
const limited = await enforceRateLimit(c, "auth_register", rateLimitKey(c), 5, 60 * 60);
|
|
16483
|
-
if (limited) return limited;
|
|
16484
16482
|
try {
|
|
16485
16483
|
const existing = await getUserByEmail(normalizedEmail);
|
|
16486
16484
|
if (existing) return c.json({ error: "Email already registered" }, 409);
|
|
16487
|
-
let stripeCustomerId;
|
|
16485
|
+
let stripeCustomerId = null;
|
|
16488
16486
|
try {
|
|
16489
16487
|
stripeCustomerId = await createSignupStripeCustomer(normalizedEmail);
|
|
16490
|
-
} catch {
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
if (!stripeCustomerId && (process.env.NODE_ENV === "production" || process.env.VERCEL === "1")) {
|
|
16494
|
-
return c.json({ error: "Stripe customer setup failed" }, 503);
|
|
16488
|
+
} catch (err) {
|
|
16489
|
+
console.warn("[auth/register] Stripe customer creation failed; continuing without it (created lazily at checkout):", err instanceof Error ? err.message : String(err));
|
|
16490
|
+
stripeCustomerId = null;
|
|
16495
16491
|
}
|
|
16496
16492
|
const user = await createUser(normalizedEmail, void 0, password, stripeCustomerId ?? void 0);
|
|
16497
16493
|
if (stripeCustomerId) {
|
|
@@ -16552,14 +16548,18 @@ var init_server = __esm({
|
|
|
16552
16548
|
if (process.env.RESEND_API_KEY) {
|
|
16553
16549
|
try {
|
|
16554
16550
|
const resend = new import_resend.Resend(process.env.RESEND_API_KEY);
|
|
16555
|
-
await resend.emails.send({
|
|
16551
|
+
const sent = await resend.emails.send({
|
|
16556
16552
|
from: "MCP Scraper <noreply@updates.mcpscraper.dev>",
|
|
16557
16553
|
to: normalizedEmail,
|
|
16558
16554
|
subject: "Reset your MCP Scraper password",
|
|
16559
16555
|
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>`
|
|
16560
16556
|
});
|
|
16561
|
-
|
|
16557
|
+
if (sent.error) console.error("[auth/forgot-password] Resend rejected the email:", JSON.stringify(sent.error));
|
|
16558
|
+
} catch (err) {
|
|
16559
|
+
console.error("[auth/forgot-password] Resend send threw:", err instanceof Error ? err.message : String(err));
|
|
16562
16560
|
}
|
|
16561
|
+
} else {
|
|
16562
|
+
console.warn("[auth/forgot-password] RESEND_API_KEY not set \u2014 no reset email sent for", normalizedEmail);
|
|
16563
16563
|
}
|
|
16564
16564
|
return c.json({ ok: true });
|
|
16565
16565
|
});
|