Skip to content

Commit

Permalink
♻️ More
Browse files Browse the repository at this point in the history
  • Loading branch information
benjlevesque committed Nov 27, 2024
1 parent daae661 commit d40de2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/applications/request-context/src/getUtilisateur.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parse } from 'node:url';
import { getServerSession } from 'next-auth';

import { Utilisateur } from '@potentiel-domain/utilisateur';
import { getLogger } from '@potentiel-libraries/monitoring';

import { authOptions } from './authOptions';
import { convertToken } from './convertToken';
Expand All @@ -30,5 +31,8 @@ export async function getUtilisateur(req: IncomingMessage, res: ServerResponse)
const utilisateur = convertToken(authHeader.slice('bearer '.length));
return Utilisateur.bind(utilisateur);
}
} catch {}
} catch (e) {
const error = e as Error;
getLogger('getUtilisateur').warn(`Auth failed: ${error}`);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export function runWithContext({ req, res, callback }: RunWithAuthContextProps)
if (ignorePath(req.url ?? '')) {
return callback();
}
console.log(req.url);

return requestContextStorage.run({ correlationId }, async () => {
const utilisateur = await getUtilisateur(req, res);
Expand Down

0 comments on commit d40de2e

Please sign in to comment.