Skip to content

Commit

Permalink
fix: incorrect usage of errorBody
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra committed Aug 1, 2024
1 parent 4c8319e commit f25b7d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/client/lib/AuthorizationCodeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const createAuthorizationRequestUrl = async ({
const client_id = clientId ?? authorizationRequest.clientId;

// Authorization server metadata takes precedence
const authorizationMetadata = endpointMetadata.authorizationServerMetadata ?? endpointMetadata.credentialIssuerMetadata
const authorizationMetadata = endpointMetadata.authorizationServerMetadata ?? endpointMetadata.credentialIssuerMetadata;

let { authorizationDetails } = authorizationRequest;
const parMode = authorizationMetadata?.require_pushed_authorization_requests
Expand Down Expand Up @@ -182,7 +182,6 @@ export const createAuthorizationRequestUrl = async ({
}
const parEndpoint = authorizationMetadata?.pushed_authorization_request_endpoint;


let queryObj: Record<string, any> | PushedAuthorizationResponse = {
response_type: ResponseType.AUTH_CODE,
...(!pkce.disabled && {
Expand Down
6 changes: 2 additions & 4 deletions packages/client/lib/functions/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ export async function sendNotification(
const error = response.errorBody?.error !== undefined;
const result = {
error,
response: error ? await response.errorBody?.json() : undefined,
response: error ? response.errorBody : undefined,
};
if (error) {
LOG.warning(
`Notification endpoint returned an error for event '${request.event}' and id ${request.notification_id}: ${await response.errorBody?.json()}`,
);
LOG.warning(`Notification endpoint returned an error for event '${request.event}' and id ${request.notification_id}: ${response.errorBody}`);
} else {
LOG.debug(`Notification endpoint returned success for event '${request.event}' and id ${request.notification_id}`);
}
Expand Down

0 comments on commit f25b7d6

Please sign in to comment.