Commit 8365867a authored by Florent Poittevin's avatar Florent Poittevin
Browse files

fix: proxy conf variable by removing prefix

parent c6eb4dc2
......@@ -20,30 +20,29 @@ exports.shortDoi = {
exports.oauth = (port) => {
return {
"/dlcm/oauth": {
"target": `http://localhost:${port}/dlcm/oauth`,
"pathRewrite": {
"^/dlcm/oauth": ""
},
"/oauth": {
"target": `http://localhost:${port}`,
// "logLevel": "debug"
},
}
}
exports.shiblogin = (port) => {
exports.shiblogin = (port, firstName = "Marty", lastName = "McFly", externalUid = "999999@unige.ch") => {
return {
"/dlcm/shiblogin": {
"/shiblogin": {
"target": `http://localhost:${port}`,
"onProxyReq": (proxyReq, req, res) => {
proxyReq.setHeader('mail', 'Marty.McFly@unige.ch');
proxyReq.setHeader('uniqueid', '999999@unige.ch');
proxyReq.setHeader('givenname', 'Marty');
proxyReq.setHeader('surname', 'McFly');
proxyReq.setHeader('mail', `${firstName}.${lastName}@unige.ch`);
proxyReq.setHeader('uniqueid', externalUid);
proxyReq.setHeader('givenname', firstName);
proxyReq.setHeader('surname', lastName);
proxyReq.setHeader('homeorganization', 'unige.ch');
proxyReq.setHeader('preferredlanguage', 'fr-ch');
},
"onProxyRes": (proxyRes, req, res) => {
proxyRes.headers['Access-Control-Allow-Origin'] = 'http://localhost:4200';
}
},
// "logLevel": "debug"
},
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment