Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Commit c742321

Browse files
authored
Merge pull request #112 from IntersectMBO/pre-prod
Pre prod
2 parents 097d498 + f887c2c commit c742321

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

backend/src/extensions/users-permissions/strapi-server.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ module.exports = (plugin) => {
6363
const publicKey = PublicKey.from_bytes(pubKeyBytes);
6464
const signature = Ed25519Signature.from_bytes(decoded.signature());
6565
const receivedData = decoded.signed_data().to_bytes();
66-
const isVerified = publicKey.verify(receivedData, signature);
66+
67+
// Remove network id from identifier
68+
const rawKeyHash = identifier.slice(2);
69+
70+
const isVerified =
71+
publicKey.verify(receivedData, signature) &&
72+
rawKeyHash === publicKey.hash().to_hex();
6773

6874
if (!isVerified) {
6975
throw new ApplicationError("Verification failed");

0 commit comments

Comments
 (0)