Support Aegis URL scheme for NIP-46 login #161

Merged
hodlbod merged 5 commits from priyanshu_bharti/flotilla:83-aegis-url-scheme into dev 2026-04-10 19:04:35 +00:00
Contributor

Summary

Adds support for Aegis and nostrsigner x-callback URL launch flow for NIP-46 login.
Handles signer callback URLs safely so the app does not navigate to callback paths.
Shows a clear error toast when signer returns an auth error.

What changed

Added x-callback URL generation for connect flow with these params:
method=connect
nostrconnect
x-source
x-success
x-error
Added remote signer launch actions in the QR login flow.
Added callback interception for authSuccess and authError in app URL open handling.

Testing done

pnpm run check passed.
pnpm run lint passed.
Local web sanity test passed:
Remote signer QR screen opens correctly.
QR is generated correctly.
Clicking QR copies the value and shows Copied to clipboard toast.

image.png

Issue

Ref #83

## Summary Adds support for Aegis and nostrsigner x-callback URL launch flow for NIP-46 login. Handles signer callback URLs safely so the app does not navigate to callback paths. Shows a clear error toast when signer returns an auth error. ## What changed Added x-callback URL generation for connect flow with these params: method=connect nostrconnect x-source x-success x-error Added remote signer launch actions in the QR login flow. Added callback interception for authSuccess and authError in app URL open handling. ## Testing done pnpm run check passed. pnpm run lint passed. Local web sanity test passed: Remote signer QR screen opens correctly. QR is generated correctly. Clicking QR copies the value and shows Copied to clipboard toast. ![image.png](/attachments/a48f129f-db04-4363-a254-9370b53a17b1) Issue Ref #83
Author
Contributor

This is now fixed and working properly
@hodlbod ,please take a look and merge if it's good.
Thanks!

This is now fixed and working properly ✅ @hodlbod ,please take a look and merge if it's good. Thanks!
hodlbod requested changes 2026-04-06 19:00:26 +00:00
@@ -22,1 +32,4 @@
<p class="text-sm opacity-75">Scan with your signer to log in, or click to copy.</p>
{#if Capacitor.isNativePlatform()}
<div class="flex w-full flex-col gap-2">
<Button class="btn btn-primary" onclick={openAegis}>Open in Aegis</Button>
Owner

Check if this platform is specifically ios, and only show "Open in Signer", not "Open in Aegis" (the aegis:// scheme I think is for backwards compatibility, which means we only need to deal with the nostrsigner:// scheme).

Check if this platform is specifically ios, and only show "Open in Signer", not "Open in Aegis" (the aegis:// scheme I think is for backwards compatibility, which means we only need to deal with the nostrsigner:// scheme).
priyanshu_bharti marked this conversation as resolved
@@ -36,0 +56,4 @@
this.signerUrls.set({
aegis: makeSignerLaunchUrl("aegis", url),
nostrsigner: makeSignerLaunchUrl("nostrsigner", url),
})
Owner

This seems like unnecessary state/indirection

This seems like unnecessary state/indirection
priyanshu_bharti marked this conversation as resolved
Author
Contributor

hii @hodlbod, could you please review it when you have time. Thanks !
if needed any type of changes,please let me know

hii @hodlbod, could you please review it when you have time. Thanks ! if needed any type of changes,please let me know
priyanshu_bharti requested review from hodlbod 2026-04-10 14:28:28 +00:00
hodlbod requested changes 2026-04-10 16:28:30 +00:00
@@ -23,0 +31,4 @@
<div class="flex w-full flex-col gap-2">
<Button class="btn btn-primary" onclick={openSigner}>Open in Signer</Button>
</div>
{/if}
Owner

Let's move this button to the a btn-neutral button below "login with a qr code instead" in BunkerLogin

Let's move this button to the a btn-neutral button below "login with a qr code instead" in BunkerLogin
priyanshu_bharti marked this conversation as resolved
priyanshu_bharti requested review from hodlbod 2026-04-10 19:02:01 +00:00
hodlbod added 5 commits 2026-04-10 19:04:27 +00:00
hodlbod force-pushed 83-aegis-url-scheme from ce23a67235 to 993cfe1c02 2026-04-10 19:04:27 +00:00 Compare
hodlbod merged commit e8c94177ca into dev 2026-04-10 19:04:35 +00:00
hodlbod deleted branch 83-aegis-url-scheme 2026-04-10 19:04:35 +00:00
Sign in to join this conversation.