Skip to content

Commit 7888a14

Browse files
committed
fix: undo tx_code changes
1 parent 81bf769 commit 7888a14

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/issuer/lib/tokens/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)