Continuação do backend
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
export class BackendError extends Error {
|
||||
constructor(message, statusCode = 400){
|
||||
super(message);
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import bcrypt from "bcryptjs";
|
||||
|
||||
const senha = "123456"
|
||||
|
||||
let senha_hash = await bcrypt.hash(senha, 10);
|
||||
|
||||
console.log(senha_hash);
|
||||
|
||||
console.log(await bcrypt.compare(senha, senha_hash))
|
||||
|
||||
Reference in New Issue
Block a user