Skip to content

Commit

Permalink
fix: remove callbackUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
esaminu committed Sep 29, 2023
1 parent e8ccefd commit d0cd716
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/components/Sign/Sign.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,12 @@ function Sign() {
};

const onCancel = () => {
try {
const url = new URL(callbackUrl);
url.searchParams.append('error', 'User cancelled action');
window.location.replace(url);
} catch (error) {
alert('Invalid callback URL');
}
const success_url = searchParams.get('success_url');
const failure_url = searchParams.get('failure_url');
const url = new URL(success_url || failure_url || window.location.origin);
url.searchParams.append('error', 'User cancelled action');
window.location.replace(url);
window.parent.postMessage({ signedDelegates: '' }, '*');
};

return (
Expand Down

0 comments on commit d0cd716

Please sign in to comment.