Allow "me" as public key when decrypting in Gun RPC
This commit is contained in:
parent
e44c89b976
commit
fe0be0134d
2 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ const deepDecryptIfNeeded = async (value, publicKey) => {
|
|||
}
|
||||
|
||||
let sec = ''
|
||||
if (user.is.pub === publicKey) {
|
||||
if (user.is.pub === publicKey || 'me' === publicKey) {
|
||||
sec = getMySecret()
|
||||
} else {
|
||||
sec = await SEA.secret(await pubToEpub(publicKey), user._.sea)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ const queryListenerCallback = ({
|
|||
})
|
||||
}
|
||||
const eventName = `query:data`
|
||||
if (publicKeyForDecryption?.length > 15) {
|
||||
if (publicKeyForDecryption) {
|
||||
const decData = await deepDecryptIfNeeded(data, publicKeyForDecryption)
|
||||
emit(eventName, { subscriptionId, response: { data: decData, key } })
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue