candidate-portal-2/test-login.js

18 lines
561 B
JavaScript

// Test login script
const bcrypt = require('bcryptjs');
// Test password hashing to verify what's stored in the demo users
async function testPassword() {
// Hash password
const password = 'password123';
const hashedPassword = await bcrypt.hash(password, 12);
console.log('Hashed password:', hashedPassword);
// Compare with stored hash
const storedHash = '$2b$12$CCIPxtBFUjfJqz8sMvJdj.9MQLE6ghAoIl/amO9uNaRc6VXcWUDiW';
const isMatch = await bcrypt.compare(password, storedHash);
console.log('Password matches:', isMatch);
}
testPassword();