File tree Expand file tree Collapse file tree
packages/issuer/lib/tokens Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,18 +100,19 @@ export const assertValidAccessTokenRequest = async (
100100 invalid_request:
101101 the Authorization Server expects a PIN in the pre-authorized flow but the client does not provide a PIN
102102 */
103- const preAuthorizedGrant = credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ]
104- if ( ( preAuthorizedGrant ?. tx_code || preAuthorizedGrant ?. user_pin_required ) && ! request . user_pin ) {
103+ if (
104+ credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ 'urn:ietf:params:oauth:grant-type:pre-authorized_code' ] ?. tx_code &&
105+ ! request . user_pin
106+ ) {
105107 throw new TokenError ( 400 , TokenErrorResponse . invalid_request , USER_PIN_REQUIRED_ERROR )
106108 }
107109 /*
108110 invalid_request:
109111 the Authorization Server does not expect a PIN in the pre-authorized flow but the client provides a PIN
110112 */
111- if ( ! preAuthorizedGrant ?. user_pin_required && ! preAuthorizedGrant ?. tx_code && request . user_pin ) {
113+ if ( ! credentialOfferSession . credentialOffer . credential_offer ?. grants ?. [ GrantTypes . PRE_AUTHORIZED_CODE ] ?. user_pin_required && request . user_pin ) {
112114 throw new TokenError ( 400 , TokenErrorResponse . invalid_request , USER_PIN_NOT_REQUIRED_ERROR )
113115 }
114-
115116 /*
116117 invalid_grant:
117118 the Authorization Server expects a PIN in the pre-authorized flow but the client provides the wrong PIN
You can’t perform that action at this time.
0 commit comments