mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Swap bcrypt library.
This commit is contained in:
parent
b294c8ef72
commit
20dc76861f
3 changed files with 22 additions and 194 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import crypto from 'crypto';
|
||||
import { v4, v5, validate } from 'uuid';
|
||||
import bcrypt from 'bcrypt';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { JWT, JWE, JWK } from 'jose';
|
||||
import { startOfMonth } from 'date-fns';
|
||||
|
||||
|
|
@ -40,11 +40,11 @@ export function getRandomChars(n) {
|
|||
}
|
||||
|
||||
export async function hashPassword(password) {
|
||||
return bcrypt.hash(password, SALT_ROUNDS);
|
||||
return bcrypt.hashSync(password, SALT_ROUNDS);
|
||||
}
|
||||
|
||||
export async function checkPassword(password, hash) {
|
||||
return bcrypt.compare(password, hash);
|
||||
return bcrypt.compareSync(password, hash);
|
||||
}
|
||||
|
||||
export async function createToken(payload) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue