Skip to content

Commit f25b7d6

Browse files
committed
fix: incorrect usage of errorBody
Signed-off-by: Timo Glastra <timo@animo.id>
1 parent 4c8319e commit f25b7d6

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

packages/client/lib/AuthorizationCodeClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const createAuthorizationRequestUrl = async ({
114114
const client_id = clientId ?? authorizationRequest.clientId;
115115

116116
// Authorization server metadata takes precedence
117-
const authorizationMetadata = endpointMetadata.authorizationServerMetadata ?? endpointMetadata.credentialIssuerMetadata
117+
const authorizationMetadata = endpointMetadata.authorizationServerMetadata ?? endpointMetadata.credentialIssuerMetadata;
118118

119119
let { authorizationDetails } = authorizationRequest;
120120
const parMode = authorizationMetadata?.require_pushed_authorization_requests
@@ -182,7 +182,6 @@ export const createAuthorizationRequestUrl = async ({
182182
}
183183
const parEndpoint = authorizationMetadata?.pushed_authorization_request_endpoint;
184184

185-
186185
let queryObj: Record<string, any> | PushedAuthorizationResponse = {
187186
response_type: ResponseType.AUTH_CODE,
188187
...(!pkce.disabled && {

packages/client/lib/functions/notifications.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ export async function sendNotification(
1919
const error = response.errorBody?.error !== undefined;
2020
const result = {
2121
error,
22-
response: error ? await response.errorBody?.json() : undefined,
22+
response: error ? response.errorBody : undefined,
2323
};
2424
if (error) {
25-
LOG.warning(
26-
`Notification endpoint returned an error for event '${request.event}' and id ${request.notification_id}: ${await response.errorBody?.json()}`,
27-
);
25+
LOG.warning(`Notification endpoint returned an error for event '${request.event}' and id ${request.notification_id}: ${response.errorBody}`);
2826
} else {
2927
LOG.debug(`Notification endpoint returned success for event '${request.event}' and id ${request.notification_id}`);
3028
}

0 commit comments

Comments
 (0)