mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Account settings page.
This commit is contained in:
parent
58a1be7a30
commit
b5cf9f8719
32 changed files with 597 additions and 162 deletions
|
|
@ -3,6 +3,7 @@ import { v4, v5, validate } from 'uuid';
|
|||
import bcrypt from 'bcrypt';
|
||||
import { JWT, JWE, JWK } from 'jose';
|
||||
|
||||
const SALT_ROUNDS = 10;
|
||||
const KEY = JWK.asKey(Buffer.from(secret()));
|
||||
|
||||
export function hash(...args) {
|
||||
|
|
@ -23,6 +24,10 @@ export function isValidId(s) {
|
|||
return validate(s);
|
||||
}
|
||||
|
||||
export function hashPassword(password) {
|
||||
return bcrypt.hash(password, SALT_ROUNDS);
|
||||
}
|
||||
|
||||
export function checkPassword(password, hash) {
|
||||
return bcrypt.compare(password, hash);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue