Files
twenty/server/src/core/auth/auth.util.ts
Charles Bochet ca5191169f Update docs, remove password strong regex, hide tasks (#755)
* Update docs, remove password strong regex, hide tasks

* Update docs
2023-07-19 09:45:31 -07:00

16 lines
366 B
TypeScript

import * as bcrypt from 'bcrypt';
export const PASSWORD_REGEX = /^.{8,}$/;
const saltRounds = 10;
export const hashPassword = async (password: string) => {
const hash = await bcrypt.hash(password, saltRounds);
return hash;
};
export const compareHash = async (password: string, passwordHash: string) => {
return bcrypt.compare(password, passwordHash);
};