Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix(api): better logging for verify oauth code

Carl-Gerhard Lindesvärde5b5a8af621c
diff --git a/apps/api/src/controllers/oauth-callback.controller.tsx b/apps/api/src/controllers/oauth-callback.controller.tsx
index cc3c2e133..e852a52aa 100644
--- a/apps/api/src/controllers/oauth-callback.controller.tsx
+++ b/apps/api/src/controllers/oauth-callback.controller.tsx
@@ -88,7 +88,7 @@ export async function githubCallback(
tokens = await github.validateAuthorizationCode(code);
} catch (error) {
req.log.error('github authorization failed', {
- error: error instanceof Error ? error.message : 'Unknown error',
+ error,
provider: 'github',
});
return reply.status(400).send('Please restart the process.');
@@ -295,7 +295,7 @@ export async function googleCallback(
tokens = await google.validateAuthorizationCode(code, codeVerifier);
} catch (error) {
req.log.error('google authorization failed', {
- error: error instanceof Error ? error.message : 'Unknown error',
+ error,
provider: 'google',
});
return reply.status(400).send('Please restart the process.');