Skip to content

Commit

Permalink
fix(wallet): Encode nonces as base64 on redirect (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
tifrel authored Aug 7, 2024
1 parent 8a93211 commit f97ad58
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/wallet/src/bitte-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const BitteWallet: WalletBehaviourFactory<

const newUrl = new URL(`${metadata.walletUrl}/sign-message`);
newUrl.searchParams.set('message', message);
newUrl.searchParams.set('nonce', nonce);
newUrl.searchParams.set('nonce', Buffer.from(nonce).toString('base64'));
newUrl.searchParams.set('recipient', recipient);
newUrl.searchParams.set('callbackUrl', cbUrl);
window.location.assign(newUrl.toString());
Expand All @@ -230,7 +230,7 @@ export const BitteWallet: WalletBehaviourFactory<
newUrl.searchParams.set('accountId', accountId);
newUrl.searchParams.set('publicKey', publicKey);
newUrl.searchParams.set('signature', signature);
newUrl.searchParams.set('nonce', nonce);
newUrl.searchParams.set('nonce', Buffer.from(nonce).toString('base64'));
newUrl.searchParams.set('recipient', recipient);
newUrl.searchParams.set('callbackUrl', callbackUrl);

Expand Down
4 changes: 2 additions & 2 deletions packages/wallet/src/mintbase-wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export const MintbaseWallet: WalletBehaviourFactory<

const newUrl = new URL(`${metadata.walletUrl}/sign-message`);
newUrl.searchParams.set('message', message);
newUrl.searchParams.set('nonce', nonce);
newUrl.searchParams.set('nonce', Buffer.from(nonce).toString('base64'));
newUrl.searchParams.set('recipient', recipient);
newUrl.searchParams.set('callbackUrl', cbUrl);
window.location.assign(newUrl.toString());
Expand All @@ -230,7 +230,7 @@ export const MintbaseWallet: WalletBehaviourFactory<
newUrl.searchParams.set('accountId', accountId);
newUrl.searchParams.set('publicKey', publicKey);
newUrl.searchParams.set('signature', signature);
newUrl.searchParams.set('nonce', nonce);
newUrl.searchParams.set('nonce', Buffer.from(nonce).toString('base64'));
newUrl.searchParams.set('recipient', recipient);
newUrl.searchParams.set('callbackUrl', callbackUrl);

Expand Down

0 comments on commit f97ad58

Please sign in to comment.