Skip to content

Commit

Permalink
fix: fixed the regex for pin
Browse files Browse the repository at this point in the history
  • Loading branch information
sksadjad committed May 16, 2024
1 parent ccac046 commit d3b2f0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/client/lib/AccessTokenClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions packages/client/lib/__tests__/IT.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down Expand Up @@ -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,
},
});

Expand Down

0 comments on commit d3b2f0c

Please sign in to comment.