@simplewebauthn/server
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -74,3 +74,3 @@ "use strict"; | ||
const notAfter = jsrsasign_1.zulutodate(issuerCert.getNotAfter()); | ||
const now = new Date(); | ||
const now = new Date(Date.now()); | ||
if (notBefore > now || notAfter < now) { | ||
@@ -77,0 +77,0 @@ throw new Error('Intermediate certificate is not yet valid or expired'); |
@@ -6,3 +6,3 @@ /// <reference types="node" /> | ||
credential: RegistrationCredentialJSON; | ||
expectedChallenge: string; | ||
expectedChallenge: string | ChallengeVerifier; | ||
expectedOrigin: string | string[]; | ||
@@ -13,2 +13,3 @@ expectedRPID?: string | string[]; | ||
}; | ||
export declare type ChallengeVerifier = (challenge: string) => boolean; | ||
/** | ||
@@ -15,0 +16,0 @@ * Verify that the user has legitimately completed the registration process |
@@ -59,3 +59,8 @@ "use strict"; | ||
// Ensure the device provided the challenge we gave it | ||
if (challenge !== expectedChallenge) { | ||
if (typeof expectedChallenge === 'function') { | ||
if (!expectedChallenge(challenge)) { | ||
throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`); | ||
} | ||
} | ||
else if (challenge !== expectedChallenge) { | ||
throw new Error(`Unexpected registration response challenge "${challenge}", expected "${expectedChallenge}"`); | ||
@@ -62,0 +67,0 @@ } |
{ | ||
"name": "@simplewebauthn/server", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "SimpleWebAuthn for Servers", | ||
@@ -62,3 +62,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "73090c98aaaf48aea660f74c965d6f4af14375eb", | ||
"gitHead": "717b7037f58ff18003309e2c1f05f5a2f7036c2d", | ||
"devDependencies": { | ||
@@ -65,0 +65,0 @@ "@types/cbor": "^5.0.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242646
3788