feat: set password as string

This commit is contained in:
karishmas6
2024-09-25 18:43:09 +05:30
parent 5029f3728d
commit 8d29edc634

View File

@@ -1,6 +1,6 @@
import bcrypt from "bcrypt"; import bcrypt from "bcrypt";
export const hashPassword = (password: any) => { export const hashPassword = (password: string) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
bcrypt.genSalt(12, (err, salt) => { bcrypt.genSalt(12, (err, salt) => {
if (err) { if (err) {
@@ -17,6 +17,6 @@ export const hashPassword = (password: any) => {
} }
// password from frontend and hash from database // password from frontend and hash from database
export const comparePassword = (password: any, hash: any) => { export const comparePassword = (password: string, hash: any) => {
return bcrypt.compare(password, hash) return bcrypt.compare(password, hash)
} }