mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Use next-basics package.
This commit is contained in:
parent
1a6af8fc41
commit
f4e0da481e
62 changed files with 255 additions and 373 deletions
|
|
@ -1,11 +1,11 @@
|
|||
/* eslint-disable no-console */
|
||||
require('dotenv').config();
|
||||
const bcrypt = require('bcryptjs');
|
||||
const { hashPassword } = require('next-basics');
|
||||
const chalk = require('chalk');
|
||||
const prompts = require('prompts');
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
const SALT_ROUNDS = 10;
|
||||
|
||||
const runQuery = async query => {
|
||||
return query.catch(e => {
|
||||
|
|
@ -24,10 +24,6 @@ const updateAccountByUsername = (username, data) => {
|
|||
);
|
||||
};
|
||||
|
||||
const hashPassword = password => {
|
||||
return bcrypt.hashSync(password, SALT_ROUNDS);
|
||||
};
|
||||
|
||||
const changePassword = async (username, newPassword) => {
|
||||
const password = hashPassword(newPassword);
|
||||
return updateAccountByUsername(username, { password });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue