Skip to content

Commit

Permalink
Fixed confusing logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jvik committed Dec 22, 2024
1 parent a47c0e3 commit 59cb641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ async function exchangeCodeForIdAndAuthToken(code: string): Promise<IdTokenRespo
}
});

if (response.status !== 200) {
console.error("Error during token exchange:", response.data);
}

return response.data;
}

Expand Down Expand Up @@ -178,7 +182,7 @@ async function startOauth(): Promise<ElawayTokenResponse | null> {

const code = await getAuthorizationCode(page);
if (code) {
console.error("Found authorization code:");
console.info("Found authorization code.");
await browser.close();

accessIdResponse = await exchangeCodeForIdAndAuthToken(code);
Expand Down

0 comments on commit 59cb641

Please sign in to comment.