Skip to content

Commit 3b9db46

Browse files
fix: allow 0 in auth_time
1 parent 3c47bed commit 3b9db46

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3549,7 +3549,7 @@ async function processGenericAccessTokenResponse(
35493549
if (claims.auth_time !== undefined) {
35503550
assertNumber(
35513551
claims.auth_time,
3552-
false,
3552+
true,
35533553
'ID Token "auth_time" (authentication time)',
35543554
INVALID_RESPONSE,
35553555
{ claims },
@@ -5186,7 +5186,7 @@ async function validateHybridResponse(
51865186
if (claims.auth_time !== undefined) {
51875187
assertNumber(
51885188
claims.auth_time,
5189-
false,
5189+
true,
51905190
'ID Token "auth_time" (authentication time)',
51915191
INVALID_RESPONSE,
51925192
{ claims },

test/authorization_code.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ test('processAuthorizationCodeResponse() nonce checks', async (t) => {
777777
test('processAuthorizationCodeResponse() auth_time checks', async (t) => {
778778
const tIssuer: lib.AuthorizationServer = { ...issuer, jwks_uri: endpoint('jwks') }
779779

780-
for (const auth_time of [0, -1, null, '1', [], {}, true]) {
780+
for (const auth_time of [-1, null, '1', [], {}, true]) {
781781
await t.throwsAsync(
782782
lib.processAuthorizationCodeResponse(
783783
tIssuer,

0 commit comments

Comments
 (0)