Skip to content

Commit

Permalink
fix: do not read token off of undefined body
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Jan 18, 2023
1 parent fdf6263 commit ebc651d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const configureAndListen = async (
Body: { token: string };
}>('/exchange', async (req, reply) => {
req.log.info('Received secret exchange request');
let { token } = req.body;
let token = req.body?.token;
if (!token) {
token = req.headers['x-oidc-token'] as string;
}
Expand Down

0 comments on commit ebc651d

Please sign in to comment.