diff --git a/lib/src/constants/data.ts b/lib/src/constants/data.ts index f42f77b2..e579146b 100644 --- a/lib/src/constants/data.ts +++ b/lib/src/constants/data.ts @@ -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"; diff --git a/lib/src/helpers/crypto-helper.ts b/lib/src/helpers/crypto-helper.ts index f9f8fbf8..0bc66790 100644 --- a/lib/src/helpers/crypto-helper.ts +++ b/lib/src/helpers/crypto-helper.ts @@ -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"; @@ -114,7 +114,7 @@ export class CryptoHelper { ) ); }).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", @@ -123,7 +123,7 @@ export class CryptoHelper { ) ); } - + return Promise.reject( new AsgardeoAuthException( "JS-CRYPTO_UTILS-IVIT-IV03",