diff --git a/dashboard/src/components/forms/client-form.tsx b/dashboard/src/components/forms/client-form.tsx index afaca44..b4191d9 100644 --- a/dashboard/src/components/forms/client-form.tsx +++ b/dashboard/src/components/forms/client-form.tsx @@ -7,12 +7,11 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; -import { kratos } from '@/ory'; -import { useEffect, useState } from 'react'; -import { Identity, OAuth2Client } from '@ory/client'; +import { useState } from 'react'; +import { OAuth2Client } from '@ory/client'; import { AxiosResponse } from 'axios'; import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { useRouter } from 'next/navigation'; import { Checkbox } from '@/components/ui/checkbox'; @@ -23,13 +22,6 @@ interface CreateClientFormProps { export function CreateClientForm({ action }: CreateClientFormProps) { const router = useRouter(); - const [identity, setIdentity] = useState(); - - useEffect(() => { - kratos.toSession() - .then(response => response.data) - .then(session => setIdentity(session.identity)); - }, []); const form = useForm>({ resolver: zodResolver(clientFormSchema), @@ -61,10 +53,6 @@ export function CreateClientForm({ action }: CreateClientFormProps) { }); }; - useEffect(() => { - form.setValue('owner', identity?.id ?? ''); - }, [identity]); - return ( <> { @@ -180,7 +168,8 @@ export function CreateClientForm({ action }: CreateClientFormProps) { /> - )}/> + )} + /> { !form.getValues('skip') && ( <> @@ -199,7 +188,8 @@ export function CreateClientForm({ action }: CreateClientFormProps) { - )}/> + )} + /> - )}/> + )} + /> - )}/> + )} + /> Owner - + Owner is a string identifying the owner of the OAuth 2.0 Client.