Slide 41
Slide 41 text
import crypto from 'crypto';
app.get('/auth', (req, res) => {
const hash = crypto.pbkdf2Sync(password, users[username].salt, 100, 512);
if (users[username].hash.toString() === hash.toString()) {
res.sendStatus(200);
} else {
res.sendStatus(401);
}
});