Skip to content

Commit b7df700

Browse files
authored
chore: add logs for debugging (calcom#19012)
1 parent fdc8e08 commit b7df700

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/app-store/_utils/oauth/OAuthManager.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ export class OAuthManager {
421421
) {
422422
throw new Error("Credential syncing is enabled but the required env variables are not set");
423423
}
424-
myLog.debug(
424+
myLog.info(
425425
"Refreshing OAuth token from credential sync endpoint",
426426
safeStringify({
427427
appSlug: this.appSlug,
@@ -449,7 +449,7 @@ export class OAuthManager {
449449
);
450450
}
451451
} else {
452-
myLog.debug(
452+
myLog.info(
453453
"Refreshing OAuth token",
454454
safeStringify({
455455
appSlug: this.appSlug,
@@ -467,7 +467,7 @@ export class OAuthManager {
467467
}
468468

469469
const clonedResponse = response.clone();
470-
myLog.debug(
470+
myLog.info(
471471
"Response from refreshOAuthToken",
472472
safeStringify({
473473
text: await clonedResponse.text(),
@@ -487,7 +487,10 @@ export class OAuthManager {
487487
}
488488
const parsedToken = OAuth2UniversalSchemaWithCalcomBackwardCompatibility.safeParse(json);
489489
if (!parsedToken.success) {
490-
myLog.error("Token parsing error:", safeStringify(parsedToken.error.issues));
490+
myLog.error(
491+
"Token parsing error:",
492+
safeStringify({ issues: parsedToken.error.issues, oauth2response: json, tokenStatus })
493+
);
491494
throw new Error("Invalid token response");
492495
}
493496
return parsedToken.data;

0 commit comments

Comments
 (0)