(password, hashedPassword)
| 20 | // Returns a promise for whether this password compares to equal this |
| 21 | // hashed password. |
| 22 | function compare(password, hashedPassword) { |
| 23 | // Cannot bcrypt compare when one is undefined |
| 24 | if (!password || !hashedPassword) { |
| 25 | return Promise.resolve(false); |
| 26 | } |
| 27 | return bcrypt.compare(password, hashedPassword); |
| 28 | } |
| 29 | |
| 30 | // Pre-computed bcrypt hash (cost factor 10) used for timing normalization. |
| 31 | // The actual value is irrelevant; it ensures bcrypt.compare() runs with |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…