Skip to content

Commit

Permalink
chore: add logs for debugging (calcom#19012)
Browse files Browse the repository at this point in the history
  • Loading branch information
Udit-takkar authored Jan 31, 2025
1 parent fdc8e08 commit b7df700
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/app-store/_utils/oauth/OAuthManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export class OAuthManager {
) {
throw new Error("Credential syncing is enabled but the required env variables are not set");
}
myLog.debug(
myLog.info(
"Refreshing OAuth token from credential sync endpoint",
safeStringify({
appSlug: this.appSlug,
Expand Down Expand Up @@ -449,7 +449,7 @@ export class OAuthManager {
);
}
} else {
myLog.debug(
myLog.info(
"Refreshing OAuth token",
safeStringify({
appSlug: this.appSlug,
Expand All @@ -467,7 +467,7 @@ export class OAuthManager {
}

const clonedResponse = response.clone();
myLog.debug(
myLog.info(
"Response from refreshOAuthToken",
safeStringify({
text: await clonedResponse.text(),
Expand All @@ -487,7 +487,10 @@ export class OAuthManager {
}
const parsedToken = OAuth2UniversalSchemaWithCalcomBackwardCompatibility.safeParse(json);
if (!parsedToken.success) {
myLog.error("Token parsing error:", safeStringify(parsedToken.error.issues));
myLog.error(
"Token parsing error:",
safeStringify({ issues: parsedToken.error.issues, oauth2response: json, tokenStatus })
);
throw new Error("Invalid token response");
}
return parsedToken.data;
Expand Down

0 comments on commit b7df700

Please sign in to comment.