CreateClerkAuthIntegrationDialog() — supabase Function Reference
Architecture documentation for the CreateClerkAuthIntegrationDialog() function in CreateClerkAuthDialog.tsx from the supabase codebase.
Entity Profile
Relationship Graph
Source Code
apps/studio/components/interfaces/Auth/ThirdPartyAuthForm/CreateClerkAuthDialog.tsx lines 56–150
export const CreateClerkAuthIntegrationDialog = ({
visible,
onClose,
onDelete,
}: CreateClerkAuthIntegrationProps) => {
const { ref: projectRef } = useParams()
const { mutate: createAuthIntegration, isPending } = useCreateThirdPartyAuthIntegrationMutation({
onSuccess: () => {
toast.success(`Successfully created a new Clerk integration.`)
onClose()
},
})
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
defaultValues: {
enabled: true,
domain: '',
},
})
useEffect(() => {
if (visible) {
form.reset({
enabled: true,
domain: '',
})
// the form input doesn't exist when the form is reset
setTimeout(() => {
form.setFocus('domain')
}, 25)
}
}, [visible])
const onSubmit: SubmitHandler<z.infer<typeof FormSchema>> = async (values) => {
createAuthIntegration({
projectRef: projectRef!,
oidcIssuerUrl: values.domain,
})
}
return (
<Dialog open={visible} onOpenChange={() => onClose()}>
<DialogContent>
<DialogHeader>
<DialogTitle className="truncate">Add new Clerk connection</DialogTitle>
</DialogHeader>
<Separator />
<DialogSection>
<Form_Shadcn_ {...form}>
<form id={FORM_ID} onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
<p className="text-sm text-foreground-light">
Register your Clerk domain. Visit{' '}
<InlineLink
href="https://dashboard.clerk.com/setup/supabase"
target="_blank"
rel="noopener"
>
Clerk's Connect with Supabase page
</InlineLink>{' '}
to configure your Clerk instance.
</p>
<FormField_Shadcn_
key="domain"
control={form.control}
name="domain"
render={({ field }) => (
<FormItemLayout label="Clerk Domain">
<FormControl_Shadcn_>
<Input_Shadcn_
{...field}
placeholder={
'https://clerk.example.com or https://example.clerk.accounts.dev'
}
/>
</FormControl_Shadcn_>
</FormItemLayout>
)}
/>
</form>
</Form_Shadcn_>
</DialogSection>
<DialogFooter>
<Button disabled={isPending} type="default" onClick={() => onClose()}>
Cancel
</Button>
<Button form={FORM_ID} htmlType="submit" disabled={isPending} loading={isPending}>
Create connection
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
)
}
Domain
Subdomains
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free