Skip to content

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

fix(auth): make most of the fields optional instead of just nullable in oauth flow

Carl-Gerhard Lindesvärd7361ef3b7933
diff --git a/apps/api/src/controllers/oauth-callback.controller.tsx b/apps/api/src/controllers/oauth-callback.controller.tsx
index 76086da45..cc3c2e133 100644
--- a/apps/api/src/controllers/oauth-callback.controller.tsx
+++ b/apps/api/src/controllers/oauth-callback.controller.tsx
@@ -104,7 +104,7 @@ export async function githubCallback(
login: z.string(),
name: z
.string()
- .nullable()
+ .nullish()
.transform((val) => val || ''),
});
const userJson = await userResponse.json();
@@ -307,15 +307,15 @@ export async function googleCallback(
sub: z.string(),
given_name: z
.string()
- .nullable()
+ .nullish()
.transform((val) => val || ''),
family_name: z
.string()
- .nullable()
+ .nullish()
.transform((val) => val || ''),
picture: z
.string()
- .nullable()
+ .nullish()
.transform((val) => val || ''),
email: z.string(),
});