Merge branch 'dev'
This commit is contained in:
commit
63b9305787
|
|
@ -2218,7 +2218,16 @@ for (const mod of getAllModules()) {
|
||||||
const accept = c.req.header("Accept") || "";
|
const accept = c.req.header("Accept") || "";
|
||||||
const isHtmlRequest = accept.includes("text/html");
|
const isHtmlRequest = accept.includes("text/html");
|
||||||
|
|
||||||
if (!isHtmlRequest && (vis === "private" || vis === "permissioned")) {
|
// Exempt public-facing endpoints that are designed for unauthenticated users
|
||||||
|
const pathname = new URL(c.req.url).pathname;
|
||||||
|
const isPublicEndpoint = pathname.endsWith("/api/flows/user-onramp")
|
||||||
|
|| pathname.endsWith("/api/onramp/config")
|
||||||
|
|| pathname.endsWith("/api/transak/config")
|
||||||
|
|| pathname.endsWith("/api/transak/webhook")
|
||||||
|
|| pathname.endsWith("/api/coinbase/webhook")
|
||||||
|
|| pathname.endsWith("/api/ramp/webhook");
|
||||||
|
|
||||||
|
if (!isHtmlRequest && !isPublicEndpoint && (vis === "private" || vis === "permissioned")) {
|
||||||
const token = extractToken(c.req.raw.headers);
|
const token = extractToken(c.req.raw.headers);
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return c.json({ error: "Authentication required" }, 401);
|
return c.json({ error: "Authentication required" }, 401);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue