Skip to content

Commit

Permalink
feat: added security measures
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasbenary committed Jan 28, 2025
1 parent 5af278e commit 5f3649e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/my-near-wallet/src/lib/my-near-wallet-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ export class MyNearWalletConnection {

const message = event.data as WalletMessage;

console.log('message', message);

if (event.origin != this._walletBaseUrl) {
return;
}
switch (message.status) {
case 'success':
childWindow?.close();
Expand Down
3 changes: 2 additions & 1 deletion packages/my-near-wallet/src/lib/my-near-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ const MyNearWallet: WalletBehaviourFactory<
if (!url) {
throw new Error(`The callbackUrl is missing for ${metadata.name}`);
}

console.log("signMessage", {message, nonce, recipient, url, state});

const href = new URL(params.walletUrl);
href.pathname = "sign-message";
href.searchParams.append("message", message);
Expand Down

0 comments on commit 5f3649e

Please sign in to comment.