Revert ugly stripping by using a top level front route
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user