mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
refactor(auth): decouple NIP-07 logic and optimize list fetching (agent)
- Moved NIP-07 extension detection and permission logic from `NostrClient` to `nip07` provider. - Removed redundant `login` method from `NostrClient`. - Increased concurrency and added timeouts to `fetchListIncrementally` to prevent hanging on slow relays. - Updated `UserBlocks` to force full fetch on cache miss, fixing "empty list" issues. - Updated unit tests for login permissions and hashtag preferences to reflect architectural changes. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
967bb079f5
commit
3c7a396da9
6 files changed
+241
-207
No files matched your search
@@ -374,18 +374,6 @@ export default class AuthService {
|
||||
const detailAuthType =
|
||||
typeof authType === "string" && authType.trim() ? authType.trim() : "nip07";
|
||||
|
||||
if (authType === "nip07") {
|
||||
const permissionResult = await requestDefaultExtensionPermissions();
|
||||
if (!permissionResult.ok) {
|
||||
const error = new Error(
|
||||
"The NIP-07 extension denied the permission request required to finish logging in.",
|
||||
);
|
||||
error.code = "extension-permission-denied";
|
||||
error.cause = permissionResult.error;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
const trimmed = typeof pubkey === "string" ? pubkey.trim() : "";
|
||||
if (!trimmed) {
|
||||
return { pubkey: null, providerId, authType: detailAuthType, signer };
|
||||
|
||||
Reference in new issue
Block a user