mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +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,14 +1,14 @@
|
|||
const bcrypt = require('bcrypt');
|
||||
const bcrypt = require('bcryptjs');
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
const prisma = new PrismaClient();
|
||||
const SALT_ROUNDS = 10;
|
||||
|
||||
const hashPassword = password => {
|
||||
return bcrypt.hash(password, SALT_ROUNDS);
|
||||
return bcrypt.hashSync(password, SALT_ROUNDS);
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const password = await hashPassword(process.env.ADMIN_PASSWORD || 'umami');
|
||||
const password = hashPassword(process.env.ADMIN_PASSWORD || 'umami');
|
||||
await prisma.account.upsert({
|
||||
where: { username: 'admin' },
|
||||
update: {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue