Merge remote-tracking branch 'brugeman/fix/nip46-main'

This commit is contained in:
2024-04-04 11:20:17 +01:00
3 changed files with 15 additions and 6 deletions

View File

@ -85,6 +85,9 @@ export default function useLoginHandler() {
}
} else if (key.startsWith("bunker://")) {
const nip46 = new Nip46Signer(key);
nip46.on("oauth", url => {
window.open(url, CONFIG.appNameCapitalized, "width=600,height=800,popup=yes");
});
await nip46.init();
const loginPubkey = await nip46.getPubKey();

View File

@ -247,6 +247,9 @@ export function createPublisher(l: LoginSession) {
const relayArgs = (l.remoteSignerRelays ?? []).map(a => `relay=${encodeURIComponent(a)}`);
const inner = new PrivateKeySigner(unwrap(l.privateKeyData as KeyStorage).value);
const nip46 = new Nip46Signer(`bunker://${unwrap(l.publicKey)}?${[...relayArgs].join("&")}`, inner);
nip46.on("oauth", url => {
window.open(url, CONFIG.appNameCapitalized, "width=600,height=800,popup=yes");
});
return new EventPublisher(nip46, unwrap(l.publicKey));
}
case LoginSessionType.Nip7os: {