make protectedKey protectedKeyIV protectedKeyTag nullable

This commit is contained in:
Maidul Islam
2024-01-24 12:40:07 -05:00
committed by Akhil Mohan
parent 86ba6355cf
commit 83bff9ae14
4 changed files with 10 additions and 10 deletions

View File

@@ -12,9 +12,9 @@ export const UserEncryptionKeysSchema = z.object({
clientPublicKey: z.string().nullable().optional(),
serverPrivateKey: z.string().nullable().optional(),
encryptionVersion: z.number().default(2).nullable().optional(),
protectedKey: z.string(),
protectedKeyIV: z.string(),
protectedKeyTag: z.string(),
protectedKey: z.string().nullable(),
protectedKeyIV: z.string().nullable(),
protectedKeyTag: z.string().nullable(),
publicKey: z.string(),
encryptedPrivateKey: z.string(),
iv: z.string(),

View File

@@ -188,7 +188,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
);
if (!backupPrivateKey) throw new Error("Failed to find backup key");
return { message: "Successfully updated backup private key", backupPrivateKey };
return { message: "Successfully fetched backup private key", backupPrivateKey };
}
});

View File

@@ -56,9 +56,9 @@ export const registerMfaRouter = async (server: FastifyZodProvider) => {
response: {
200: z.object({
encryptionVersion: z.number().default(1).nullable().optional(),
protectedKey: z.string(),
protectedKeyIV: z.string(),
protectedKeyTag: z.string(),
protectedKey: z.string().nullable(),
protectedKeyIV: z.string().nullable(),
protectedKeyTag: z.string().nullable(),
publicKey: z.string(),
encryptedPrivateKey: z.string(),
iv: z.string(),

View File

@@ -52,9 +52,9 @@ export const registerLoginRouter = async (server: FastifyZodProvider) => {
z.object({
mfaEnabled: z.literal(false),
encryptionVersion: z.number().default(1).nullable().optional(),
protectedKey: z.string(),
protectedKeyIV: z.string(),
protectedKeyTag: z.string(),
protectedKey: z.string().nullable(),
protectedKeyIV: z.string().nullable(),
protectedKeyTag: z.string().nullable(),
publicKey: z.string(),
encryptedPrivateKey: z.string(),
iv: z.string(),