Node-Jose JWS.CreateSign

201 Views Asked by At

I've read all the Promise posts and still can't get this right. No matter what way I write it, I get a " Promise { }". How do I write this statement to get the promise result, not pending.

`let jws = jose.JWS.createSign({ format: 'compact', fields }, signingKey)
.update(Buffer.from(compressedPayload))
.final()
.then(function(result) {
    jws = result;
    });

var myjws = jws.then(function(result){ return jws});
console.log("My JWS is:", myjws)'




My JWS is: Promise { <pending> }

What am I doing wrong? Thanks

0

There are 0 best solutions below