Skip to content

Commit

Permalink
From Dev to Qa
Browse files Browse the repository at this point in the history
  • Loading branch information
vpaunovic committed Aug 23, 2024
2 parents e6e0b29 + 5e6a2b5 commit bca4b99
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 bca4b99

Please sign in to comment.