Skip to content

Commit

Permalink
Merge pull request #112 from IntersectMBO/pre-prod
Browse files Browse the repository at this point in the history
Pre prod
  • Loading branch information
Nemanzh authored Aug 23, 2024
2 parents 097d498 + f887c2c commit c742321
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/src/extensions/users-permissions/strapi-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ module.exports = (plugin) => {
const publicKey = PublicKey.from_bytes(pubKeyBytes);
const signature = Ed25519Signature.from_bytes(decoded.signature());
const receivedData = decoded.signed_data().to_bytes();
const isVerified = publicKey.verify(receivedData, signature);

// Remove network id from identifier
const rawKeyHash = identifier.slice(2);

const isVerified =
publicKey.verify(receivedData, signature) &&
rawKeyHash === publicKey.hash().to_hex();

if (!isVerified) {
throw new ApplicationError("Verification failed");
Expand Down

0 comments on commit c742321

Please sign in to comment.