mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-25 03:49:11 +00:00
simplify interactions verify
This commit is contained in:
parent
6583471f40
commit
0d5bc60c92
1 changed files with 6 additions and 12 deletions
|
@ -21,16 +21,10 @@ export const verifyRequest = async (
|
||||||
['verify']
|
['verify']
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
return crypto.subtle.verify(
|
||||||
!(await crypto.subtle.verify(
|
'NODE-ED25519',
|
||||||
'NODE-ED25519',
|
key,
|
||||||
key,
|
Buffer.from(signature, 'hex'),
|
||||||
Buffer.from(signature, 'hex'),
|
Buffer.from(timestamp + JSON.stringify(interaction))
|
||||||
Buffer.from(timestamp + JSON.stringify(interaction))
|
);
|
||||||
))
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue