diff --git a/src/hooks/useLoginActions.ts b/src/hooks/useLoginActions.ts
index f0d98a97..1fdac3d5 100644
--- a/src/hooks/useLoginActions.ts
+++ b/src/hooks/useLoginActions.ts
@@ -1,5 +1,6 @@
import { useNostr } from '@nostrify/react';
import { NLogin, useNostrLogin } from '@nostrify/react/login';
+import type { NostrConnectParams } from '@nostrify/react/login';
// NOTE: This file should not be edited except for adding new login methods.
@@ -18,6 +19,14 @@ export function useLoginActions() {
const login = await NLogin.fromBunker(uri, nostr);
addLogin(login);
},
+ // Login via client-initiated NIP-46 ("nostrconnect://" QR code).
+ // Caller generates params with `generateNostrConnectParams`, renders the
+ // URI as a QR/deep-link, and awaits this promise — it resolves when the
+ // remote signer connects back over the relay.
+ async nostrconnect(params: NostrConnectParams, signal?: AbortSignal): Promise
{
+ const login = await NLogin.fromNostrConnect(params, nostr, { signal });
+ addLogin(login);
+ },
// Login with a NIP-07 browser extension
async extension(): Promise {
const login = await NLogin.fromExtension();
diff --git a/src/pages/RemoteLoginSuccess.tsx b/src/pages/RemoteLoginSuccess.tsx
new file mode 100644
index 00000000..f22675de
--- /dev/null
+++ b/src/pages/RemoteLoginSuccess.tsx
@@ -0,0 +1,43 @@
+import { useSeoMeta } from "@unhead/react";
+import { useEffect } from "react";
+import { CheckCircle2 } from "lucide-react";
+
+// Callback target for mobile NIP-46 signer apps after they approve a
+// `nostrconnect://` request. The actual login completes via the relay
+// subscription in the original tab — this page just provides a friendly
+// landing if the signer opened it in a new tab/window.
+const RemoteLoginSuccess = () => {
+ useSeoMeta({
+ title: "Signer connected",
+ description: "You can return to Shakespeare.",
+ });
+
+ useEffect(() => {
+ // Best-effort: most signers open this in a new tab. Try to close it;
+ // the manual link below is the fallback when the browser refuses.
+ window.setTimeout(() => {
+ try {
+ window.close();
+ } catch {
+ // ignored
+ }
+ }, 500);
+ }, []);
+
+ return (
+
+
+
+
Signer connected
+
+ You can return to Shakespeare. Your login should complete automatically.
+
+
+ Open Shakespeare
+
+
+
+ );
+};
+
+export default RemoteLoginSuccess;