Skip to content

Commit

Permalink
Change debugging output
Browse files Browse the repository at this point in the history
  • Loading branch information
geofflamrock committed Sep 29, 2023
1 parent 843248b commit 8261519
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ async function exchangeOidcTokenForAccessToken(
},
});

context.debug(`Token exchange response - Status: ${tokenExchangeResponse.status}`);

if (!tokenExchangeResponse.ok) {
// Some versions of Octopus Server return errors in the "Octopus" format,
// whereas later versions will return errors in the spec format from https://www.rfc-editor.org/rfc/rfc8693#section-2.2.2.
// In order to support both we'll test for the spec version and if we don't find any data we'll fall back to the Octopus version.
context.info(`tokenExchangeResponse: ${tokenExchangeResponse}`);

const errorBody = await tokenExchangeResponse.json();

context.info(`errorBody: ${errorBody}`);
context.debug(`Token exchange error response: ${errorBody}`);

// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
const specErrorBody: ExchangeOidcTokenErrorResponse = errorBody as ExchangeOidcTokenErrorResponse;
Expand Down

0 comments on commit 8261519

Please sign in to comment.