feat: applied hashed password change in change-password route

This commit is contained in:
=
2024-06-12 19:25:06 +05:30
parent e3f87382a3
commit a9bec84d27
8 changed files with 768 additions and 213 deletions
@@ -51,7 +51,8 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
encryptedPrivateKeyIV: z.string().trim(),
encryptedPrivateKeyTag: z.string().trim(),
salt: z.string().trim(),
verifier: z.string().trim()
verifier: z.string().trim(),
password: z.string().trim()
}),
response: {
200: z.object({
+13 -4
View File
@@ -20,11 +20,20 @@ export const registerUserRouter = async (server: FastifyZodProvider) => {
response: {
200: z.object({
user: UsersSchema.merge(
UserEncryptionKeysSchema.omit({
UserEncryptionKeysSchema.pick({
clientPublicKey: true,
serverPrivateKey: true,
encryptionVersion: true,
protectedKey: true,
protectedKeyIV: true,
protectedKeyTag: true,
publicKey: true,
encryptedPrivateKey: true,
iv: true,
tag: true,
salt: true,
verifier: true,
serverEncryptedPrivateKey: true,
serverEncryptedPrivateKeyIV: true,
serverEncryptedPrivateKeyTag: true
userId: true
})
)
})