feat(wip): login

This commit is contained in:
Hasta Ragil Saputra
2021-12-06 22:09:24 +07:00
parent 5a401ec862
commit 659c7e4de8
13 changed files with 306 additions and 8 deletions

View File

@@ -3,7 +3,10 @@ import * as crypto from 'crypto';
export function hashPassword(password, salt): Promise<string> {
return new Promise((resolve, reject) => {
crypto.pbkdf2(password, salt, 50, 100, 'sha512', (err, values) => {
if (err) return reject(err);
if (err) {
return reject(err);
}
resolve(values.toString('hex'));
});
});