use full event when signing with the extension.

because if the client is building the event with the pubkey A, but
the actual key used by the extension is B, using just the `.sig`
property of the value returned by `window.nostr.signEvent()` will
cause the event to be invalid.
This commit is contained in:
fiatjaf 2023-02-25 13:47:09 -03:00 committed by Jonathan Staab
parent e72106f765
commit 3a57aea96e

View File

@ -28,11 +28,13 @@ const sign = async event => {
event.pubkey = get(pubkey)
event.id = getEventHash(event)
event.sig = ext
? prop('sig', await ext.signEvent(event))
: signEvent(event, get(privkey))
return event
if (ext) {
return await ext.signEvent(event)
} else {
event.sign = signEvent(event, get(privkey))
return event
}
}
const getCrypt = () => {