Skip to content

Commit

Permalink
test. createProxyMiddelware
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikv committed Aug 8, 2024
1 parent 9a7ff3c commit 921a878
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server/src/proxy/decorator-intern-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ const setup = (app: Express) => {
}),
);

app.use((err: any, req: any, res: any, next: any) => {
console.error(err.stack);
res.status(500).send('Something broke!');
});

app.use(
'/modiacontextholder/redirect',
async (req, _, next) => {
const accessToken = await requestOboToken(process.env.MODIACONTEXTHOLDER_API_SCOPE, req);
req.headers = { Authorization: `Bearer ${accessToken}` };
req.headers['Authorization'] = `Bearer ${accessToken}`;
req.headers['cookie'] = 'innlogget-part=VEILEDER; ' + req.headers['cookie'];
next();
},
createProxyMiddleware({
Expand Down

0 comments on commit 921a878

Please sign in to comment.