From b70afcf16ce2c567f422438a2d0bcaeb23bd357a Mon Sep 17 00:00:00 2001 From: Markus Thielker Date: Tue, 25 Feb 2025 15:58:53 +0100 Subject: [PATCH] NORY-46: add client auth mechanism --- .../src/components/forms/client-form.tsx | 53 +++++++++++++++++-- dashboard/src/lib/forms/client-form.ts | 1 + 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/dashboard/src/components/forms/client-form.tsx b/dashboard/src/components/forms/client-form.tsx index 054023e..84ceebf 100644 --- a/dashboard/src/components/forms/client-form.tsx +++ b/dashboard/src/components/forms/client-form.tsx @@ -15,6 +15,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com import { useRouter } from 'next/navigation'; import { Checkbox } from '@/components/ui/checkbox'; import { Minus } from 'lucide-react'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; interface CreateClientFormProps { action: (data: z.infer) => Promise>; @@ -60,13 +61,13 @@ export function CreateClientForm({ action }: CreateClientFormProps) { setRedirectUris([...redirectUris, '']); }; - const removeRedirectUri = (index) => { + const removeRedirectUri = (index: number) => { const updatedRedirectUris = redirectUris.filter((_, i) => i !== index); setRedirectUris(updatedRedirectUris); form.setValue('redirect_uris', updatedRedirectUris); }; - const handleInputChange = (index, event) => { + const handleInputChange = (index: number, event: any) => { const updatedRedirectUris = [...redirectUris]; updatedRedirectUris[index] = event.target.value; setRedirectUris(updatedRedirectUris); @@ -165,8 +166,8 @@ export function CreateClientForm({ action }: CreateClientFormProps) { )} - {form.errors?.redirect_uris && form.errors.redirect_uris[index] && ( - {form.errors.redirect_uris[index].message} + {form.formState.errors?.redirect_uris && form.formState.errors.redirect_uris[index] && ( + {form.formState.errors.redirect_uris[index].message} )} @@ -341,6 +342,50 @@ export function CreateClientForm({ action }: CreateClientFormProps) { + + + + Client authentication mechanism + + + Set the client authentication method for the token endpoint. By default the client + credentials must be sent in the body of an HTTP POST. This option can also specify for + sending the credentials encoded in the HTTP Authorization header or by using JSON Web + Tokens. Specify none for public clients (native apps, mobile apps) which can not have + secrets. + + + + ( + + Authentication method + + + + )} + /> + + +