Fix verify route
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user