fix: tested password reset in prod, not working for some reason

pull/182/head
tycrek 1 year ago
parent 63a06d004d
commit 93dc91a761
No known key found for this signature in database
GPG Key ID: FF8A54DCE404885A

@ -137,7 +137,9 @@ export const setUserPassword = (unid: string, password: string): Promise<User> =
const authData = fs.readJsonSync(authPath) as Users;
const userIndex = authData.users.findIndex((user) => user.unid === unid);
authData.users[userIndex] = user;
fs.writeJson(authPath, authData, { spaces: '\t' });
fs.writeJson(authPath, authData, { spaces: '\t' })
.then(() => resolve(user))
.catch(reject);
});
/**

@ -54,7 +54,7 @@ function buildUserRouter() {
setUserPassword(id, newPassword)
.then(() => res.sendStatus(200))
.catch(() => res.sendStatus(500));
.catch((err) => (log.error(err), res.sendStatus(500)));
});
// Create a new user

Loading…
Cancel
Save