Code Room
Code reviewHard
Question
Review this Node.js password-reset token generator.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
const crypto = require('crypto'); function createResetToken(userId) { const seed = Date.now() + ':' + userId; const token = crypto.createHash('md5').update(seed).digest('hex'); resets.set(token, { userId, exp: Date.now() + 3600_000 }); return token;}// emailed as https://app/reset?token=<token>Run or narrate your approach, then ask the coach.