Update frontend login page.jsx และ backend
This commit is contained in:
@@ -1,4 +1,14 @@
|
||||
import bcrypt from 'bcrypt';
|
||||
// FILE: src/utils/passwords.js
|
||||
// Password hashing and verification utilities
|
||||
// - Uses bcrypt for secure password hashing
|
||||
// - Provides hashPassword(plain) and verifyPassword(plain, hash) functions
|
||||
// - hashPassword returns a promise that resolves to the hashed password
|
||||
// - verifyPassword returns a promise that resolves to true/false
|
||||
// - Uses 10 salt rounds for hashing
|
||||
// - Assumes bcrypt package is installed
|
||||
// - Suitable for user authentication systems
|
||||
// - Can be used in user registration and login flows
|
||||
import bcrypt from "bcrypt";
|
||||
export async function hashPassword(plain) {
|
||||
const saltRounds = 10;
|
||||
return bcrypt.hash(plain, saltRounds);
|
||||
|
||||
Reference in New Issue
Block a user