Skip to content

Commit

Permalink
improve typo
Browse files Browse the repository at this point in the history
  • Loading branch information
yathindrak committed Apr 21, 2022
1 parent 5d93e1c commit 2332248
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/src/constants/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ export const SUPPORTED_SIGNATURE_ALGORITHMS = [
"RS256", "RS512", "RS384", "PS256"
];

export const JOSE_CLAIM_VALIDATION_ERROR: string = "ERR_JWT_CLAIM_VALIDATION_FAILED";
export const JOSE_NBF_CLAIM: string= "nbf";
export const CLAIM_VALIDATION_ERROR: string = "ERR_JWT_CLAIM_VALIDATION_FAILED";
export const NBF_CLAIM: string= "nbf";
6 changes: 3 additions & 3 deletions lib/src/helpers/crypto-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import { JOSE_CLAIM_VALIDATION_ERROR, JOSE_NBF_CLAIM, SUPPORTED_SIGNATURE_ALGORITHMS } from "../constants";
import { CLAIM_VALIDATION_ERROR, NBF_CLAIM, SUPPORTED_SIGNATURE_ALGORITHMS } from "../constants";
import { AsgardeoAuthException } from "../exception";
import { CryptoUtils, DecodedIDTokenPayload, JWKInterface } from "../models";

Expand Down Expand Up @@ -114,7 +114,7 @@ export class CryptoHelper<T = any> {
)
);
}).catch((error) => {
if(error?.code === JOSE_CLAIM_VALIDATION_ERROR && error?.claim === JOSE_NBF_CLAIM) {
if(error?.code === CLAIM_VALIDATION_ERROR && error?.claim === NBF_CLAIM) {
return Promise.reject(
new AsgardeoAuthException(
"JS-CRYPTO_UTILS-IVIT-IV02",
Expand All @@ -123,7 +123,7 @@ export class CryptoHelper<T = any> {
)
);
}

return Promise.reject(
new AsgardeoAuthException(
"JS-CRYPTO_UTILS-IVIT-IV03",
Expand Down

0 comments on commit 2332248

Please sign in to comment.