Fix verify route
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"title": "Community Rule",
|
"title": "Community Rule",
|
||||||
"author": "MEDLab",
|
"author": "MEDLab",
|
||||||
"description": "Community governance and rule-building app",
|
"description": "Community governance and rule-building app",
|
||||||
"version": "0.1.6",
|
"version": "0.1.7",
|
||||||
"httpPort": 3000,
|
"httpPort": 3000,
|
||||||
"healthCheckPath": "/api/health",
|
"healthCheckPath": "/api/health",
|
||||||
"memoryLimit": 805306368,
|
"memoryLimit": 805306368,
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
logRouteError,
|
logRouteError,
|
||||||
} from "../../../../../lib/server/requestId";
|
} from "../../../../../lib/server/requestId";
|
||||||
import { safeInternalPath } from "../../../../../lib/safeInternalPath";
|
import { safeInternalPath } from "../../../../../lib/safeInternalPath";
|
||||||
|
import { getPublicOrigin } from "../../../../../lib/server/publicOrigin";
|
||||||
|
|
||||||
const SCOPE = "auth.magicLink.verify";
|
const SCOPE = "auth.magicLink.verify";
|
||||||
|
|
||||||
@@ -100,7 +101,7 @@ function redirectWithRequestId(
|
|||||||
path: string,
|
path: string,
|
||||||
requestId: string,
|
requestId: string,
|
||||||
): NextResponse {
|
): 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);
|
res.headers.set(REQUEST_ID_HEADER, requestId);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
getSessionUser,
|
getSessionUser,
|
||||||
setSessionCookie,
|
setSessionCookie,
|
||||||
} from "../../../../../lib/server/session";
|
} from "../../../../../lib/server/session";
|
||||||
|
import { getPublicOrigin } from "../../../../../lib/server/publicOrigin";
|
||||||
|
|
||||||
const SCOPE = "invites.ruleStakeholder.verify";
|
const SCOPE = "invites.ruleStakeholder.verify";
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ function redirectWithRequestId(
|
|||||||
path: string,
|
path: string,
|
||||||
requestId: string,
|
requestId: string,
|
||||||
): NextResponse {
|
): 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);
|
res.headers.set(REQUEST_ID_HEADER, requestId);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
getOrCreateRequestId,
|
getOrCreateRequestId,
|
||||||
logRouteError,
|
logRouteError,
|
||||||
} from "../../../../../lib/server/requestId";
|
} from "../../../../../lib/server/requestId";
|
||||||
|
import { getPublicOrigin } from "../../../../../lib/server/publicOrigin";
|
||||||
|
|
||||||
const SCOPE = "user.emailChange.verify";
|
const SCOPE = "user.emailChange.verify";
|
||||||
|
|
||||||
@@ -166,7 +167,7 @@ function redirectWithRequestId(
|
|||||||
path: string,
|
path: string,
|
||||||
requestId: string,
|
requestId: string,
|
||||||
): NextResponse {
|
): 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);
|
res.headers.set(REQUEST_ID_HEADER, requestId);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user