Revert ugly stripping by using a top level front route

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-15 18:39:45 +04:00
committed by Bryan Frimin
parent c5cd225d95
commit cbd873fd57
5 changed files with 42 additions and 48 deletions

View File

@@ -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()

View File

@@ -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")