add Nostr-login package #217

Merged
enes merged 20 commits from nostr-login-9-30 into staging 2024-10-09 08:54:33 +00:00
Member

This PR will replace our custom implementation of the login methods (nip05, npub, nbunker, extension) with the package nostr-login (https://github.com/nostrband/nostr-login).
The package adds additional login methods for the users, aside from the existing ones, which include using a signup (generate new key pairs), using connect method directly for amber (https://github.com/greenart7c3/Amber) and nsec.app (https://nsec.app/).
The old development login method with private keys is kept for development purposes mostly and can be removed at a later date.

PR also includes the following changes:

  • removed bunker related code
  • removed popup only routes for login, register and nostr (open nostr-login directly)
  • optimized logout (reducers and state management)
  • Introduce strategy pattern for the login methods - PrivateKeyStrategy and NostrLoginStrategy which change how we encrypt and decrypt the data in NostrController, adding a new login method should be a lot smoother in the future (hopefully 🤞)
  • logout turned into a hook - useLogout
  • removed extention delay code, this is now handled by nostr-login
  • updated settings page to include nostr-login related popup links - links to account-switch and import/export screens
  • updated settings/profile page to include a link to the import/export screen if we are using local method (generated keys)

Additional fixes:

  • add rel=noopener to some links
  • add not-allowed cursor to coming soon fields
  • fixed z-index issues

Still WIP due to:

  • a re-rendering issue on the logout -> fixed with better deps
  • lack of comments (strategy pattern and a few other places)
  • requires more testing to make sure the new login is robust (at least as the old method) -> No issues today
This PR will replace our custom implementation of the login methods (`nip05`, `npub`, `nbunker`, `extension`) with the package `nostr-login` (https://github.com/nostrband/nostr-login). The package adds additional login methods for the users, aside from the existing ones, which include using a signup (generate new key pairs), using `connect` method directly for `amber` (https://github.com/greenart7c3/Amber) and `nsec.app` (https://nsec.app/). The old development login method with private keys is kept for development purposes mostly and can be removed at a later date. PR also includes the following changes: - removed bunker related code - removed popup only routes for login, register and nostr (open nostr-login directly) - optimized logout (reducers and state management) - Introduce strategy pattern for the login methods - `PrivateKeyStrategy` and `NostrLoginStrategy` which change how we encrypt and decrypt the data in `NostrController`, adding a new login method should be a lot smoother in the future (hopefully 🤞) - logout turned into a hook - `useLogout` - removed extention delay code, this is now handled by `nostr-login` - updated `settings` page to include `nostr-login` related popup links - links to `account-switch` and `import`/export screens - updated `settings/profile` page to include a link to the `import`/export screen if we are using `local` method (generated keys) Additional fixes: - add `rel=noopener` to some links - add `not-allowed` cursor to *coming soon* fields - fixed z-index issues Still WIP due to: - [x] a re-rendering issue on the logout -> fixed with better deps - [x] lack of comments (strategy pattern and a few other places) - [x] requires more testing to make sure the new login is robust (at least as the old method) -> No issues today
enes added 5 commits 2024-10-05 13:20:37 +00:00
enes force-pushed nostr-login-9-30 from 802a6bc6ab to 995c7ce293 2024-10-07 17:21:46 +00:00 Compare
enes added 1 commit 2024-10-07 18:37:55 +00:00
refactor: add useCallback, add methods and split effects
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 34s
331759de5c
enes added 6 commits 2024-10-08 16:50:43 +00:00
enes added 1 commit 2024-10-08 17:12:31 +00:00
refactor(login): add comments
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 34s
aa4637dd0d
enes changed title from WIP: add Nostr-login package to add Nostr-login package 2024-10-08 17:57:08 +00:00
enes added 1 commit 2024-10-08 18:06:43 +00:00
Merge branch 'staging' into nostr-login-9-30
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
fe9f282984
enes added 1 commit 2024-10-08 18:14:52 +00:00
refactor(ts): remove type assertion
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
f09d9b2378
enes added 1 commit 2024-10-08 18:25:41 +00:00
refactor: add comments
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 32s
3a507246ca
enes requested review from eugene 2024-10-08 18:26:31 +00:00
enes added 1 commit 2024-10-09 08:35:16 +00:00
Merge branch 'staging' into nostr-login-9-30
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
8deb5bd7cd
eugene approved these changes 2024-10-09 08:47:15 +00:00
enes merged commit b6846c0006 into staging 2024-10-09 08:54:33 +00:00
enes deleted branch nostr-login-9-30 2024-10-09 08:54:34 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sigit/sigit.io#217
No description provided.