feat: create secret with password

This commit is contained in:
lemmyMwaura
2024-08-06 12:58:27 +03:00
parent f606e31b98
commit ce4ba24ef2
2 changed files with 6 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ export const SecretSharingSchema = z.object({
expiresAfterViews: z.number().nullable().optional(),
accessType: z.string().default("anyone"),
name: z.string().nullable().optional(),
password: z.string().optional(),
password: z.string().nullable().optional(),
lastViewedAt: z.date().nullable().optional()
});

View File

@@ -36,6 +36,7 @@ export const secretSharingServiceFactory = ({
iv,
tag,
name,
password,
accessType,
expiresAt,
expiresAfterViews
@@ -62,6 +63,7 @@ export const secretSharingServiceFactory = ({
const newSharedSecret = await secretSharingDAL.create({
name,
password,
encryptedValue,
hashedHex,
iv,
@@ -77,6 +79,7 @@ export const secretSharingServiceFactory = ({
};
const createPublicSharedSecret = async ({
password,
encryptedValue,
hashedHex,
iv,
@@ -103,6 +106,7 @@ export const secretSharingServiceFactory = ({
}
const newSharedSecret = await secretSharingDAL.create({
password,
encryptedValue,
hashedHex,
iv,
@@ -111,6 +115,7 @@ export const secretSharingServiceFactory = ({
expiresAfterViews,
accessType
});
return { id: newSharedSecret.id };
};