fix: password being set when empty

This commit is contained in:
diced 2024-04-24 20:48:26 -07:00
parent e997250cf8
commit fc98015950
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1

View file

@ -49,7 +49,7 @@ export default fastifyPlugin(
let password: string | null | undefined = undefined;
if (req.body.password !== undefined) {
if (req.body.password === null) {
if (req.body.password === null || req.body.password === '') {
password = null;
} else if (typeof req.body.password === 'string') {
password = await hashPassword(req.body.password);