Catch failure to verify events

This commit is contained in:
Jon Staab
2024-02-09 14:06:01 -08:00
parent 7cb792ba17
commit 4a0ae3770e
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -82,7 +82,13 @@ export const hasValidSignature = cached<string, boolean, [Event]>({
return 'invalid'
}
},
getValue: ([e]: [Event]) => verifyEvent(e),
getValue: ([e]: [Event]) => {
try {
return verifyEvent(e)
} catch (err) {
return false
}
},
})
// ==========================================================================