Closed dagingaa closed 5 years ago
That's one of the reasons the major version was bumped. However, you can easily migrate your old data:
old.hash('foo')
.then(json => verify(migrate(json), 'foo'))
.then(console.log)
function migrate(json) {
const data = JSON.parse(json)
return JSON.stringify({
...data,
salt: Buffer.from(data.salt, 'utf8').toString('base64'),
})
}
If you try to verify hashes generated by credentials@2.0.0 the verify function with return false.
This can be easily replicated by running the following code on Runkit:
https://runkit.com/embed/zgp4an2ckb58
In case Runkit doesn't work, you can try to verify the following hash with 3.0.2:
password is "foo".