From cbd873fd5723080f0d5dc49672e201d8ee547141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Thu, 15 Jan 2026 18:39:45 +0400 Subject: [PATCH] Revert ugly stripping by using a top level front route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- apps/trust/src/pages/auth/AuthLayout.tsx | 10 +-- .../src/pages/auth/VerifyMagicLinkPage.tsx | 65 ++++++++++--------- apps/trust/src/routes.tsx | 10 +-- pkg/iam/auth_service.go | 2 +- pkg/server/server.go | 3 - 5 files changed, 42 insertions(+), 48 deletions(-) diff --git a/apps/trust/src/pages/auth/AuthLayout.tsx b/apps/trust/src/pages/auth/AuthLayout.tsx index b57160d7d..a60cc13d4 100644 --- a/apps/trust/src/pages/auth/AuthLayout.tsx +++ b/apps/trust/src/pages/auth/AuthLayout.tsx @@ -1,13 +1,13 @@ import { Logo } from "@probo/ui"; -import { Outlet } from "react-router"; +import type { PropsWithChildren } from "react"; + +export function AuthLayout(props: PropsWithChildren) { + const { children } = props; -export default function () { return (
-
- -
+
{children}
diff --git a/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx b/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx index 846c5485d..5646686df 100644 --- a/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx +++ b/apps/trust/src/pages/auth/VerifyMagicLinkPage.tsx @@ -10,6 +10,7 @@ import { useMutation } from "react-relay"; import { formatError } from "@probo/helpers"; import type { VerifyMagicLinkPageMutation } from "./__generated__/VerifyMagicLinkPageMutation.graphql"; import { getPathPrefix } from "/utils/pathPrefix"; +import { AuthLayout } from "./AuthLayout"; const verifyMagicLinkMutation = graphql` mutation VerifyMagicLinkPageMutation($input: VerifyMagicLinkInput!) { @@ -84,37 +85,39 @@ export default function VerifyMagicLinkPagePageMutation() { }); return ( -
-
-

{__("Email Confirmation")}

-

- {__("Confirm your email address to complete registration")} -

+ +
+
+

{__("Email Confirmation")}

+

+ {__("Confirm your email address to complete registration")} +

+
+ +
+ + + +
- -
- - - - -
+ ); } diff --git a/apps/trust/src/routes.tsx b/apps/trust/src/routes.tsx index 25535c4a6..063a7d53f 100644 --- a/apps/trust/src/routes.tsx +++ b/apps/trust/src/routes.tsx @@ -32,14 +32,8 @@ function ErrorBoundary({ error: propsError }: { error?: string }) { const routes = [ { - path: "/auth", - Component: lazy(() => import("./pages/auth/AuthLayout")), - children: [ - { - path: "verify-magic-link", - Component: lazy(() => import("./pages/auth/VerifyMagicLinkPage.tsx")), - }, - ], + path: "/verify-magic-link", + Component: lazy(() => import("./pages/auth/VerifyMagicLinkPage.tsx")), }, { path: "/", diff --git a/pkg/iam/auth_service.go b/pkg/iam/auth_service.go index 79498516e..90d3c2af1 100644 --- a/pkg/iam/auth_service.go +++ b/pkg/iam/auth_service.go @@ -560,7 +560,7 @@ func (s AuthService) SendMagicLink(ctx context.Context, req *SendMagicLinkReques } magicLinkURL := req.BaseURL. - WithPath("/auth/verify-magic-link"). + WithPath("/verify-magic-link"). WithQuery("token", token). MustString() diff --git a/pkg/server/server.go b/pkg/server/server.go index 83ca23111..5874e893a 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -149,8 +149,6 @@ func (s *Server) stripTrustPrefix(next http.Handler) http.Handler { } r.URL.Path = strings.TrimPrefix(r.URL.Path, prefix) - r.URL.Path = strings.TrimPrefix(r.URL.Path, "/auth") - if r.URL.Path == "" { r.URL.Path = "/" } @@ -172,7 +170,6 @@ func (s *Server) TrustCenterHandler() http.Handler { r := chi.NewRouter() r.Use(compliancepage.NewSNIMiddleware(s.trustService)) - r.Use(s.stripTrustPrefix) r.Use(func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Strict-Transport-Security", "max-age=31536000; preload")