From d3b2f0c23b74ceb031d1e812847c9bf20ee17ae5 Mon Sep 17 00:00:00 2001 From: sksadjad Date: Thu, 16 May 2024 11:22:06 +0200 Subject: [PATCH] fix: fixed the regex for pin --- packages/client/lib/AccessTokenClient.ts | 2 +- packages/client/lib/__tests__/IT.spec.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/lib/AccessTokenClient.ts b/packages/client/lib/AccessTokenClient.ts index cd0c5b40..688c9969 100644 --- a/packages/client/lib/AccessTokenClient.ts +++ b/packages/client/lib/AccessTokenClient.ts @@ -175,7 +175,7 @@ export class AccessTokenClient { } // Default regex for alphanumeric with no specific length limit if no input_mode is specified. - regex = regex || /^[a-zA-Z0-9]+$/; + regex = regex || /^[a-zA-Z0-9]+$|^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+$/; if (!pin || !regex.test(pin)) { debug( diff --git a/packages/client/lib/__tests__/IT.spec.ts b/packages/client/lib/__tests__/IT.spec.ts index 917e690d..59292f1c 100644 --- a/packages/client/lib/__tests__/IT.spec.ts +++ b/packages/client/lib/__tests__/IT.spec.ts @@ -262,7 +262,7 @@ describe('OIDVCI-Client for v1_0_13 should', () => { issuer_state: '32fc4ebf-9e31-4149-9877-e3c0b602d559', }, 'urn:ietf:params:oauth:grant-type:pre-authorized_code': { - pre_authorized_code: + 'pre-authorized_code': 'eyJhbGciOiJFZERTQSJ9.eyJzdWIiOiIzMmZjNGViZi05ZTMxLTQxNDktOTg3Ny1lM2MwYjYwMmQ1NTkiLCJpc3MiOiJodHRwczovL21pam5rdmsuYWNjLmNyZWRlbmNvLmNvbSIsImF1ZCI6IlRPS0VOIn0.754aiQ87O0vHYSpRvPqAS9cLOgf-pewdeXbpLziRwsxEp9mENfaXpY62muYpzOaWcYmTOydkzhFul-NDYXJZCA', }, }, @@ -324,7 +324,7 @@ describe('OIDVCI-Client for v1_0_13 should', () => { issuer_state: '32fc4ebf-9e31-4149-9877-e3c0b602d559', }, 'urn:ietf:params:oauth:grant-type:pre-authorized_code': { - pre_authorized_code: preAuthorizedCode, + 'pre-authorized_code': preAuthorizedCode, }, });