diff --git a/backend-pg/src/db/schemas/user-encryption-keys.ts b/backend-pg/src/db/schemas/user-encryption-keys.ts index 0fde37ae7..41a7ae57d 100644 --- a/backend-pg/src/db/schemas/user-encryption-keys.ts +++ b/backend-pg/src/db/schemas/user-encryption-keys.ts @@ -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(), diff --git a/backend-pg/src/server/routes/v1/password-router.ts b/backend-pg/src/server/routes/v1/password-router.ts index f28a92b89..8ec7697f7 100644 --- a/backend-pg/src/server/routes/v1/password-router.ts +++ b/backend-pg/src/server/routes/v1/password-router.ts @@ -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 }; } }); diff --git a/backend-pg/src/server/routes/v2/mfa-router.ts b/backend-pg/src/server/routes/v2/mfa-router.ts index 6372e870b..7b8c27204 100644 --- a/backend-pg/src/server/routes/v2/mfa-router.ts +++ b/backend-pg/src/server/routes/v2/mfa-router.ts @@ -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(), diff --git a/backend-pg/src/server/routes/v3/login-router.ts b/backend-pg/src/server/routes/v3/login-router.ts index 404f3a0c4..22d7b8be7 100644 --- a/backend-pg/src/server/routes/v3/login-router.ts +++ b/backend-pg/src/server/routes/v3/login-router.ts @@ -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(),