Skip to content

Commit

Permalink
set sec-username/sec-roles in webpack proxy config
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
landryb committed Dec 10, 2024
1 parent 2ebdbd7 commit 0b5844a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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'
}
}
}}
);

0 comments on commit 0b5844a

Please sign in to comment.