Skip to content

feat: add npub read-only login#198

Merged
barrydeen merged 1 commit intomainfrom
feat/npub-read-only-login
Mar 10, 2026
Merged

feat: add npub read-only login#198
barrydeen merged 1 commit intomainfrom
feat/npub-read-only-login

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Allow login with npub or 64-char hex pubkey for read-only browsing — signer is null so all write actions silently no-op
  • Add READ_ONLY signing mode to KeyRepository with savePubkeyReadOnly() and isReadOnly()
  • Refactor AuthViewModel.logIn() to detect input type (nsec/npub/hex) and route accordingly
  • Read-only login skips existing-user onboarding and goes straight to loading screen
  • Fix pre-existing bug: clear stale notifications, events, and DMs in reloadForNewAccount() so account switches don't show old data

Test plan

  • Login with an npub → skips onboarding → lands on feed with that user's content
  • Login with 64-char hex pubkey → same behavior
  • Tap reply/react/repost/compose → nothing happens (silent no-op)
  • Navigate to profiles, notifications, relays → all viewable
  • DMs tab → conversations empty (can't decrypt)
  • Keys screen → shows npub only
  • Logout → back to auth screen
  • Login with nsec → full functionality still works
  • Login with remote signer → still works
  • Logout of one account, login to another → notifications show new account's data

Allow users to log in with an npub or hex pubkey to browse the app
in read-only mode. Signer is set to null so all write actions silently
no-op. Also fix stale notifications/events/DMs persisting across
account switches in reloadForNewAccount().
@barrydeen barrydeen merged commit 7ed30fc into main Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant