From 6d0335a86a255019e7a58836cabe11bfdbf26711 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Sat, 23 May 2026 18:28:20 -0600 Subject: [PATCH] Fix verify route --- CloudronManifest.json | 2 +- app/api/auth/magic-link/verify/route.ts | 3 ++- app/api/invites/rule-stakeholder/verify/route.ts | 3 ++- app/api/user/email-change/verify/route.ts | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CloudronManifest.json b/CloudronManifest.json index 7812579..ea8598d 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -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, diff --git a/app/api/auth/magic-link/verify/route.ts b/app/api/auth/magic-link/verify/route.ts index d0f6c18..bcfdfe5 100644 --- a/app/api/auth/magic-link/verify/route.ts +++ b/app/api/auth/magic-link/verify/route.ts @@ -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; } diff --git a/app/api/invites/rule-stakeholder/verify/route.ts b/app/api/invites/rule-stakeholder/verify/route.ts index ed63b04..1f8ef10 100644 --- a/app/api/invites/rule-stakeholder/verify/route.ts +++ b/app/api/invites/rule-stakeholder/verify/route.ts @@ -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; } diff --git a/app/api/user/email-change/verify/route.ts b/app/api/user/email-change/verify/route.ts index c40399b..4e6a08f 100644 --- a/app/api/user/email-change/verify/route.ts +++ b/app/api/user/email-change/verify/route.ts @@ -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; }