Skip to content

Commit 8a5b7c1

Browse files
committed
CCM-10422: unit tests
1 parent 0007da0 commit 8a5b7c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

utils/utils/src/__tests__/lambda-cognito-authorizer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ describe('LambdaCognitoAuthorizer', () => {
401401
);
402402
});
403403

404-
test('returns failure when sub on Cognito UserAttributes does not match expected subject or clientId', async () => {
404+
test('returns failure when expected resourc owner matches neither notify client id nor sub, from Cognito', async () => {
405405
const jwt = sign(
406406
{
407407
token_use: 'access',

utils/utils/src/lambda-cognito-authorizer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export class LambdaCognitoAuthorizer {
9292

9393
if (
9494
expectedSubjectOrClientId !== undefined &&
95-
(expectedSubjectOrClientId !== sub ||
96-
expectedSubjectOrClientId !== notifyClientId)
95+
expectedSubjectOrClientId !== sub &&
96+
expectedSubjectOrClientId !== notifyClientId
9797
) {
9898
this.logger.warn(
9999
'Neither subject nor clientId matches expected resource owner'

0 commit comments

Comments
 (0)