We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b1d88d commit a2712ffCopy full SHA for a2712ff
packages/better-auth/src/api/middlewares/origin-check.ts
@@ -47,7 +47,10 @@ export const originCheckMiddleware = createAuthMiddleware(async (ctx) => {
47
const isTrustedOrigin = trustedOrigins.some(
48
(origin) =>
49
matchesPattern(url, origin) ||
50
- (url?.startsWith("/") && label !== "origin" && !url.includes(":")),
+ (url?.startsWith("/") &&
51
+ label !== "origin" &&
52
+ !url.includes(":") &&
53
+ !url.includes("//")),
54
);
55
if (!isTrustedOrigin) {
56
ctx.context.logger.error(`Invalid ${label}: ${url}`);
0 commit comments