Skip to content

Commit

Permalink
chore: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Jun 12, 2023
1 parent 18caa1c commit 60c3d6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/jwt.service.spec.ts
Expand Up @@ -343,7 +343,7 @@ describe('JWT Service', () => {
// @ts-expect-error
jwtService.sign(testPayloadStr, { expiresIn: 60 })
).toThrowError(
'Not allowed payload as string with these sign options: expiresIn'
'Payload as string is not allowed with the following sign options: expiresIn'
);
});

Expand All @@ -352,7 +352,7 @@ describe('JWT Service', () => {
// @ts-expect-error
jwtService.signAsync(testPayloadStr, { notBefore: 60 })
).toThrowError(
'Not allowed payload as string with these sign options: expiresIn, notBefore'
'Payload as string is not allowed with the following sign options: expiresIn, notBefore'
);
});

Expand All @@ -368,13 +368,13 @@ describe('JWT Service', () => {

it('should "sign" expect errors using "payload" string with already defined invalid sign options', () => {
expect(() => jwtService.sign(testPayloadStr)).toThrowError(
'Not allowed payload as string with these sign options: expiresIn'
'Payload as string is not allowed with the following sign options: expiresIn'
);
});

it('should "signAsync" expect errors using "payload" string with already defined invalid sign options', () => {
expect(() => jwtService.signAsync(testPayloadStr)).toThrowError(
'Not allowed payload as string with these sign options: expiresIn'
'Payload as string is not allowed with the following sign options: expiresIn'
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions lib/jwt.service.ts
Expand Up @@ -42,7 +42,7 @@ export class JwtService {
signOptKeys.some((k) => !allowedSignOptKeys.includes(k))
) {
throw new Error(
'Not allowed payload as string with these sign options: ' +
'Payload as string is not allowed with the following sign options: ' +
signOptKeys.join(', ')
);
}
Expand Down Expand Up @@ -80,7 +80,7 @@ export class JwtService {
signOptKeys.some((k) => !allowedSignOptKeys.includes(k))
) {
throw new Error(
'Not allowed payload as string with these sign options: ' +
'Payload as string is not allowed with the following sign options: ' +
signOptKeys.join(', ')
);
}
Expand Down

0 comments on commit 60c3d6e

Please sign in to comment.