mirror of
https://github.com/PR0M3TH3AN/bitlogin.git
synced 2026-10-27 16:41:25 +00:00
Implements login-methods.md §LM4. New signers/ layer in the widget: detectForeignNip07Provider never mistakes BitLogin's own provider for an extension, and Nip07Signer wraps the snapshotted provider with capability probing (typed SignerUnsupportedError instead of TypeErrors off missing nip44), deadlines on every call (SignerTimeoutError -- no silent hangs), pubkey validation, and unsigned-event normalization. The element routes its public API through the active signer, so hosts get the extension backend transparently. Extension sessions are thin (§LM7): no capsule, no vault (requestNwcConnection resolves null), no persistence, and window.nostr is left to the extension -- claimSigner stays reserved for BitLogin-account sessions. bitlogin-login now carries method and capabilities; publicKey is unchanged for existing hosts. Password-first pinned (owner decision, §LM9.1): the extension option renders as a secondary link under the primary sign-in, enforced in securityPolicy.test.ts alongside a pin that the extension confirm path never claims window.nostr or writes storage. 14 new signer tests. Co-Authored-By: Claude Fable 5 <[email protected]>