diff --git a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx index 4e4c3bffd..4f2cffd44 100644 --- a/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx +++ b/frontend/src/pages/organization/AppConnections/AppConnectionsPage/components/AppConnectionForm/GitHubConnectionForm.tsx @@ -46,9 +46,11 @@ type Props = { const formSchema = genericAppConnectionFieldsSchema.extend({ app: z.literal(AppConnection.GitHub), method: z.nativeEnum(GitHubConnectionMethod), - credentials: z.object({ - host: z.string().optional() - }) + credentials: z + .object({ + host: z.string().optional() + }) + .optional() }); type FormData = z.infer; @@ -92,7 +94,7 @@ export const GitHubConnectionForm = ({ appConnection }: Props) => { ); const githubHost = - formData.credentials.host && formData.credentials.host.length > 0 + formData.credentials?.host && formData.credentials.host.length > 0 ? `https://${formData.credentials.host}` : "https://github.com";