Skip to content

Commit

Permalink
mer token workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
sindredl committed Aug 9, 2024
1 parent 8b29b41 commit 2f7908a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/src/proxy/api-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const setup = (app: Express, audience: string) => {
return req.originalUrl.replace('/tiltaksgjennomforing/api', '/tiltaksgjennomforing-api');
},
proxyReqOptDecorator: async (options: any, req: Request<{}, any, any, ParsedQs, Record<string, any>>) => {
if (publicPaths.includes(req.path)) return options;
const accessToken = await requestOboToken(audience, req);
options.headers.Authorization = `Bearer ${accessToken}`;
return options;
Expand Down

0 comments on commit 2f7908a

Please sign in to comment.