Add nsec-based login support#106
Open
auggie-lahey wants to merge 2 commits into
Open
Conversation
- Add signInWithNsec function to nostr.js for direct key login - Store nsec encrypted in localStorage for local event signing - Modify signAndSendEvent to fallback to stored nsec when no extension - Update getPublicKey to derive from stored nsec - Add nsec input UI in EnterRoom when no NIP-07 extension detected - Fix incorrect relative import path in RoomHeader2.jsx Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Show sign-in status (name, avatar, green badge) on home page - Add "Sign in with Nostr Extension" and "Sign in with nsec" buttons - Fetch profile metadata from relays and persist to identity for rooms - Add sign-out button that clears stored keys and reloads - Fix updateInfo to always update local state even if server save fails Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to sign in with an nsec private key, enabling Nostr login for users without a NIP-07 browser extension.
Changes
signInWithNsecfunction inui/nostr/nostr.js— decodes nsec, derives pubkey, signs a login event locally using schnorr (via nostr-tools), fetches user metadata, and sets the identitysignAndSendEvent— now falls back to stored nsec signing whenwindow.nostris unavailable, so all Nostr features (follows, zaps, live chat, etc.) work with nsec logingetPublicKey— derives pubkey from stored nsec when no extension is presentui/views/EnterRoom.jsx— when no NIP-07 extension is detected, users see a "Login with nsec" button that reveals a password input fieldRoomHeader2.jsx(../../nostr/emojiText.js→../nostr/emojiText.js)Test plan
yarn build🤖 Generated with Claude Code