feat(wip): login
This commit is contained in:
@@ -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'));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user