Skip to content

Commit

Permalink
fix: ajout de logger sur la transmission par api_key (#3612)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Gaucher <[email protected]>
  • Loading branch information
Pomarom and Pomarom authored Mar 22, 2024
1 parent 6357ba8 commit 5020672
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server/src/common/actions/organismes/organismes.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ export async function getOrganismeDetails(ctx: AuthContext, organismeId: ObjectI
export async function getOrganismeByAPIKey(api_key: string, queryString: Request["query"]): Promise<IOrganisme> {
const organisme = await organismesDb().findOne({ api_key });
if (!organisme) {
logger.error({ module: "transmission", api_key, queryString }, "Cannot find organisme from api_key");
throw Boom.forbidden("La clé API n'est pas valide", { queryString });
}
return organisme;
Expand Down

0 comments on commit 5020672

Please sign in to comment.