Closed sloonz closed 4 years ago
I use this code to generate a keypair :
const Paseto = require('paseto.js'); async function main() { const priv = new Paseto.PrivateKey(new Paseto.V2()); await priv.generate(); const pub = await priv.public(); console.log(`Private key: ${(await priv.raw()).toString('base64')}`); console.log(`Public key: ${(await pub.raw()).toString('base64')}`); } main().catch(err => { console.log(err); });
Unfortunately, this fails because priv.public() returns undefined instead of a promise. The callback-style API works fine.
priv.public()
Thanks for the report, will look at and hopefully get a fix up over the weekend.
Fixed in 0.1.6.
0.1.6
Thank you !
I use this code to generate a keypair :
Unfortunately, this fails because
priv.public()
returns undefined instead of a promise. The callback-style API works fine.