Fully re-enable client-side signature verification
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 41s Details

This commit is contained in:
Ladd Hoffman 2024-03-23 14:30:05 -05:00
parent 25e515e0bb
commit 53e0745532
1 changed files with 3 additions and 7 deletions

View File

@ -5,7 +5,7 @@ import { recoverPersonalSignature } from '@metamask/eth-sig-util';
import objectHash from 'object-hash/dist/object_hash';
// Make Buffer available to recoverPersonalSignature
// window.Buffer = Buffer;
window.Buffer = Buffer;
class Post {
constructor({
@ -26,12 +26,8 @@ class Post {
throw new Error('Hash mismatch');
}
// Verify signature
let recovered;
try {
recovered = recoverPersonalSignature({ data: content, signature });
} catch (e) {
throw new Error('Signature error', e);
}
const recovered = recoverPersonalSignature({ data: content, signature });
if (recovered !== author) {
throw new Error('Author mismatch');
}