-
Notifications
You must be signed in to change notification settings - Fork 4
Handle deeplinks fallback mode #1106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
pages/app/index.tsx
Outdated
| const webUrl = `https://cashtab.com/#/send?bip21=${bip21String}` | ||
|
|
||
| try { | ||
| const isAvailable = await cashtab.isExtensionAvailable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might actually not be needed as it seems impossible to install the cashtab extension on mobile anyway, so we could jump to cashtab web directly and only handle cashtab-connect on the client to save a redirect. Waiting for confirmation.
When a deeplink is not handled by an app on the user device, the browser opens the /app page and attempts to open the cashtab extension, then the cashtab web wallet if the extension is not available or the user rejects the payment. This has been tested on a dev server by manually calling the URL like so: http://localhost:3000/app?address=ecash:qplv39yx80kdqejh4ag6c3t30aatj9mausupeyjzr7&amount=100.00
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ✏️ Tip: You can disable in-progress messages and the fortune message in your review settings. Tip CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.Add a .trivyignore file to your project to customize which findings Trivy reports. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughTwo files are modified to implement a new BIP21 redirect handler. The auth configuration adds "/app" to authorized unlogged URLs, and a new Next.js page handles server-side BIP21 validation and client-side redirect logic to Cashtab with appropriate error handling. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cashtab will still be called via a redirection if no app handles the link first. This makes this code compatible with both mobile and desktop with no special case. Works together with PayButton/paybutton-server#1106.
|
Simplified by not handling cashtab-connect which is not needed, see PayButton/paybutton#611 |
When a deeplink is not handled by an app on the user device, the browser opens the /app page and attempts to open the cashtab web wallet.
The cashtab extension is managed on the client-side and doesn't need to happen on the server side: if the user has no app nor extension installed, redirecting to cashtab is the expected behavior.
This has been tested on a dev server by manually calling the URL like so: http://localhost:3000/app?address=ecash:qplv39yx80kdqejh4ag6c3t30aatj9mausupeyjzr7&amount=100.00
Summary by CodeRabbit