Skip to content

Commit 4c8319e

Browse files
committed
fix: headers for error response
Signed-off-by: Timo Glastra <timo@animo.id>
1 parent 86d0423 commit 4c8319e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/client/lib/functions/dpopUtil.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function shouldRetryTokenRequestWithDPoPNonce(response: OpenIDResponse<un
88
return { ok: false };
99
}
1010

11-
const dPoPNonce = response.errorBody.headers.get('DPoP-Nonce');
11+
const dPoPNonce = response.origResponse.headers.get('DPoP-Nonce');
1212
if (!dPoPNonce) {
1313
throw new Error('Missing required DPoP-Nonce header.');
1414
}
@@ -21,12 +21,12 @@ export function shouldRetryResourceRequestWithDPoPNonce(response: OpenIDResponse
2121
return { ok: false };
2222
}
2323

24-
const wwwAuthenticateHeader = response.errorBody.headers?.get('WWW-Authenticate');
24+
const wwwAuthenticateHeader = response.origResponse.headers.get('WWW-Authenticate');
2525
if (!wwwAuthenticateHeader?.includes(dpopTokenRequestNonceError)) {
2626
return { ok: false };
2727
}
2828

29-
const dPoPNonce = response.errorBody.headers.get('DPoP-Nonce');
29+
const dPoPNonce = response.origResponse.headers.get('DPoP-Nonce');
3030
if (!dPoPNonce) {
3131
throw new Error('Missing required DPoP-Nonce header.');
3232
}

packages/oid4vci-common/lib/types/Generic.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export interface JsonLdIssuerCredentialDefinition {
218218
credentialSubject?: IssuerCredentialSubject;
219219
}
220220

221-
export interface ErrorResponse extends Response {
221+
export interface ErrorResponse {
222222
error: string;
223223
error_description?: string;
224224
error_uri?: string;

0 commit comments

Comments
 (0)