Skip to content

Commit

Permalink
feat(cb2-10665): refactor code to ensure logs are always populated
Browse files Browse the repository at this point in the history
  • Loading branch information
LGin-BJSS committed Mar 21, 2024
1 parent d37c352 commit c2fc02f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const getValidJwt = async (authorizationToken: string, logEvent: ILogEven
throw new Error(JWT_MESSAGE.DECODE_FAILED);
}

await checkSignature(authorizationToken, decoded, tenantId, clientId);

let username;
const payload = decoded.payload as CVSJWTPayload;

Expand All @@ -36,6 +34,9 @@ export const getValidJwt = async (authorizationToken: string, logEvent: ILogEven

logEvent.email = username;
logEvent.tokenExpiry = new Date((payload.exp as number) * 1000).toISOString();

await checkSignature(authorizationToken, decoded, tenantId, clientId);

return decoded;
};

Expand Down

0 comments on commit c2fc02f

Please sign in to comment.