mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Change to synchronous password hashing.
This commit is contained in:
parent
756beb2cf5
commit
b2d04c00ac
5 changed files with 12 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
|||
require('dotenv').config();
|
||||
const bcrypt = require('bcrypt');
|
||||
const bcrypt = require('bcryptjs');
|
||||
const chalk = require('chalk');
|
||||
const prompts = require('prompts');
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
|
|
@ -25,11 +25,11 @@ const updateAccountByUsername = (username, data) => {
|
|||
};
|
||||
|
||||
const hashPassword = password => {
|
||||
return bcrypt.hash(password, SALT_ROUNDS);
|
||||
return bcrypt.hashSync(password, SALT_ROUNDS);
|
||||
};
|
||||
|
||||
const changePassword = async (username, newPassword) => {
|
||||
const password = await hashPassword(newPassword);
|
||||
const password = hashPassword(newPassword);
|
||||
return updateAccountByUsername(username, { password });
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue