From 0321ec32fb34bdd09a291b28cb49da183357dff9 Mon Sep 17 00:00:00 2001 From: lemmyMwaura Date: Tue, 6 Aug 2024 12:26:23 +0300 Subject: [PATCH] feat: add password input --- .../components/ShareSecretForm.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/ShareSecretPublicPage/components/ShareSecretForm.tsx b/frontend/src/views/ShareSecretPublicPage/components/ShareSecretForm.tsx index da9aa3c98..87dc34ad6 100644 --- a/frontend/src/views/ShareSecretPublicPage/components/ShareSecretForm.tsx +++ b/frontend/src/views/ShareSecretPublicPage/components/ShareSecretForm.tsx @@ -32,6 +32,7 @@ const viewLimitOptions = [ const schema = z.object({ name: z.string().optional(), + password: z.string().optional(), secret: z.string(), expiresIn: z.string(), viewLimit: z.string(), @@ -67,7 +68,7 @@ export const ShareSecretForm = ({ isPublic, value }: Props) => { } }); - const onFormSubmit = async ({ name, secret, expiresIn, viewLimit, accessType }: FormData) => { + const onFormSubmit = async ({ name, password, secret, expiresIn, viewLimit, accessType }: FormData) => { try { const expiresAt = new Date(new Date().getTime() + Number(expiresIn)); @@ -80,6 +81,7 @@ export const ShareSecretForm = ({ isPublic, value }: Props) => { const { id } = await createSharedSecret.mutateAsync({ name, + password, encryptedValue: ciphertext, hashedHex, iv, @@ -149,6 +151,19 @@ export const ShareSecretForm = ({ isPublic, value }: Props) => { )} /> + ( + + + + )} + />