fix: proxy subscribe through Next.js API route to avoid network permission prompt
Browser was requesting local network access for the Tailscale URL. Now both forms POST to /api/subscribe which proxies server-side to the leads-api container. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
import { useState, useEffect, useRef, useCallback } from "react";
|
||||
|
||||
const API_URL = "https://alezmad-nuc.tail58f5ad.ts.net";
|
||||
|
||||
type Phase = "boot" | "prompt" | "sending" | "done";
|
||||
|
||||
const BOOT_LINES = [
|
||||
@@ -86,7 +84,7 @@ export function SubscribeModal() {
|
||||
setPhase("sending");
|
||||
setError("");
|
||||
try {
|
||||
const res = await fetch(`${API_URL}/subscribe`, {
|
||||
const res = await fetch("/api/subscribe", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ email: email.trim(), project: "cladm" }),
|
||||
|
||||
Reference in New Issue
Block a user