Skip to content

Commit a39670e

Browse files
committed
chore(oauth): forward proto/host (xfwd) in the dev proxy so bootstrap redirects use https
1 parent 874ad5a commit a39670e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

webapp/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export default defineConfig(({ mode }) => {
7878
exclude: ['@tginternal/library'],
7979
},
8080
server: {
81+
https: { cert: 'localhost.pem', key: 'localhost-key.pem' },
8182
// this ensures that the browser opens upon server start
8283
open: true,
8384
host: process.env.VITE_HOST || undefined,
@@ -99,6 +100,10 @@ export default defineConfig(({ mode }) => {
99100
target:
100101
process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:8080',
101102
changeOrigin: false,
103+
// Forward X-Forwarded-Proto/Host so the backend (forward-headers-strategy: framework) builds https URLs
104+
// for the /oauth2/authorize -> /oauth2/bootstrap redirect; otherwise it emits http and the https-only dev
105+
// server can't load it.
106+
xfwd: true,
102107
},
103108
])
104109
),

0 commit comments

Comments
 (0)