mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: add password input
This commit is contained in:
@@ -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) => {
|
||||
</FormControl>
|
||||
)}
|
||||
/>
|
||||
<Controller
|
||||
control={control}
|
||||
name="password"
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<FormControl
|
||||
label="Password (Optional)"
|
||||
isError={Boolean(error)}
|
||||
errorText={error?.message}
|
||||
>
|
||||
<Input {...field} placeholder="Password" type="text" />
|
||||
</FormControl>
|
||||
)}
|
||||
/>
|
||||
<Controller
|
||||
control={control}
|
||||
name="expiresIn"
|
||||
|
||||
Reference in New Issue
Block a user