Proxy compliance portal API paths in Vite

Vite only forwarded /graphql, so /initiate?continue=… fell through
to the SPA and the locale loader rewrote it to /en/initiate.
Match the host-root API routes (including query strings) so local
OAuth hits the Go backend.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-07-29 13:04:30 +02:00
parent 1d19879b51
commit 39d5c58f20

View File

@@ -113,12 +113,14 @@ export default defineConfig(({ mode, command }) => {
port: 5174,
proxy: proxyTarget
? {
"^/graphql": {
// Host-routed compliance-portal API (trust-center HTTPS listener).
target: proxyTarget,
changeOrigin: true,
secure: false, // local step-ca
},
// Host-routed compliance-portal API (trust-center HTTPS listener).
// Match pathname only; req.url may include ?continue=… etc.
"^/(?:graphql|initiate|callback|brand/(?:logo|dark-logo)|\\.well-known/oauth-client-metadata)(?:\\?|$)":
{
target: proxyTarget,
changeOrigin: true,
secure: false, // local step-ca
},
}
: undefined,
},