fix: password being reset when editing urls (#872)

This commit is contained in:
diced
2025-09-02 15:53:56 -07:00
parent 003dba9ce4
commit a92f072d62
3 changed files with 11 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import { config } from '@/lib/config';
import { hashPassword } from '@/lib/crypto';
import { randomCharacters } from '@/lib/random';
import { prisma } from '@/lib/db';
import { Url } from '@/lib/db/models/url';
import { cleanUrlPasswords, Url } from '@/lib/db/models/url';
import { log } from '@/lib/logger';
import { z } from 'zod';
import { onShorten } from '@/lib/webhooks';
@@ -173,12 +173,9 @@ export default fastifyPlugin(
where: {
userId: req.user.id,
},
omit: {
password: true,
},
});
return res.send(urls);
return res.send(cleanUrlPasswords(urls));
});
done();