From 0b5844a4e3d463577966af57ea9d4cb00eb4c8b9 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 12 Nov 2024 15:58:23 +0000 Subject: [PATCH] set sec-username/sec-roles in webpack proxy config allows testing features restricted to connected users /cas correctly proxies to cas, but /whoami still replies '{"GeorchestraUser":null}' so the header shows the login button. --- webpack.config.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 350a0ce06..9f459b1f7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -44,7 +44,10 @@ module.exports = require("./MapStore2/build/buildConfig")({ target: `${DEV_PROTOCOL}://${DEV_HOST}/mapstore`, secure: false, headers: { - host: `${DEV_HOST}` + host: `${DEV_HOST}`, + // change those for your local instance + "sec-username": 'testadmin', + "sec-roles": 'ROLE_MAPSTORE_ADMIN' } }, "/pdf": { @@ -82,6 +85,23 @@ module.exports = require("./MapStore2/build/buildConfig")({ headers: { host: `${DEV_HOST}` } + }, + "/cas": { + target: `${DEV_PROTOCOL}://${DEV_HOST}`, + secure: false, + headers: { + host: `${DEV_HOST}` + } + }, + "/whoami": { + target: `${DEV_PROTOCOL}://${DEV_HOST}`, + secure: false, + headers: { + host: `${DEV_HOST}`, + // change those for your local instance + "sec-username": 'testadmin', + "sec-roles": 'ROLE_MAPSTORE_ADMIN' + } } }} );