Fix verify route

This commit is contained in:
adilallo
2026-05-23 18:28:20 -06:00
parent b84d80c3a9
commit 6d0335a86a
4 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
"title": "Community Rule",
"author": "MEDLab",
"description": "Community governance and rule-building app",
"version": "0.1.6",
"version": "0.1.7",
"httpPort": 3000,
"healthCheckPath": "/api/health",
"memoryLimit": 805306368,
+2 -1
View File
@@ -17,6 +17,7 @@ import {
logRouteError,
} from "../../../../../lib/server/requestId";
import { safeInternalPath } from "../../../../../lib/safeInternalPath";
import { getPublicOrigin } from "../../../../../lib/server/publicOrigin";
const SCOPE = "auth.magicLink.verify";
@@ -100,7 +101,7 @@ function redirectWithRequestId(
path: string,
requestId: string,
): NextResponse {
const res = NextResponse.redirect(new URL(path, request.url));
const res = NextResponse.redirect(new URL(path, getPublicOrigin(request)));
res.headers.set(REQUEST_ID_HEADER, requestId);
return res;
}
@@ -16,6 +16,7 @@ import {
getSessionUser,
setSessionCookie,
} from "../../../../../lib/server/session";
import { getPublicOrigin } from "../../../../../lib/server/publicOrigin";
const SCOPE = "invites.ruleStakeholder.verify";
@@ -116,7 +117,7 @@ function redirectWithRequestId(
path: string,
requestId: string,
): NextResponse {
const res = NextResponse.redirect(new URL(path, request.url));
const res = NextResponse.redirect(new URL(path, getPublicOrigin(request)));
res.headers.set(REQUEST_ID_HEADER, requestId);
return res;
}
+2 -1
View File
@@ -16,6 +16,7 @@ import {
getOrCreateRequestId,
logRouteError,
} from "../../../../../lib/server/requestId";
import { getPublicOrigin } from "../../../../../lib/server/publicOrigin";
const SCOPE = "user.emailChange.verify";
@@ -166,7 +167,7 @@ function redirectWithRequestId(
path: string,
requestId: string,
): NextResponse {
const res = NextResponse.redirect(new URL(path, request.url));
const res = NextResponse.redirect(new URL(path, getPublicOrigin(request)));
res.headers.set(REQUEST_ID_HEADER, requestId);
return res;
}