Skip to content

Commit

Permalink
try remove auth header
Browse files Browse the repository at this point in the history
  • Loading branch information
kenglxn committed Mar 7, 2024
1 parent af4e464 commit e48a225
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,17 @@ const proxyOptions = {
],
};

const artiklerProxyMiddleware = createProxyMiddleware({
...proxyOptions,
pathRewrite: { '^/': '' },
on: {
proxyReq: (proxyReq, req, res) => {
proxyReq.removeHeader('Authorization');
},
},
target: 'https://storage.googleapis.com/fager-prod-msa-artikler-public',
});

const main = async () => {
let appReady = false;
const app = express();
Expand Down Expand Up @@ -259,14 +270,7 @@ const main = async () => {
},
}
);
app.use(
'/min-side-arbeidsgiver/artikler',
createProxyMiddleware({
...proxyOptions,
pathRewrite: { '^/': '' },
target: 'https://storage.googleapis.com/fager-prod-msa-artikler-public',
})
);
app.use('/min-side-arbeidsgiver/artikler', artiklerProxyMiddleware);
} else {
app.use(
'/min-side-arbeidsgiver/tiltaksgjennomforing-api',
Expand Down Expand Up @@ -392,14 +396,7 @@ const main = async () => {
})
);

app.use(
'/min-side-arbeidsgiver/artikler',
createProxyMiddleware({
...proxyOptions,
pathRewrite: { '^/': '' },
target: 'https://storage.googleapis.com/fager-prod-msa-artikler-public',
})
);
app.use('/min-side-arbeidsgiver/artikler', artiklerProxyMiddleware);

app.get('/min-side-arbeidsgiver/redirect-til-login', (req, res) => {
const target = new URL(LOGIN_URL);
Expand Down

0 comments on commit e48a225

Please sign in to comment.