mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 00:42:30 +00:00
Merge pull request #1900 from PR0M3TH3AN/fix-nip07-permissions-17914553616063457773
fix(auth): request NIP-07 permissions during login and fix retry order
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -2103,6 +2103,15 @@ export class NostrClient {
|
||||
}
|
||||
}
|
||||
|
||||
const permissionResult = await this.ensureExtensionPermissions([
|
||||
...DEFAULT_NIP07_PERMISSION_METHODS,
|
||||
...DEFAULT_NIP07_ENCRYPTION_METHODS,
|
||||
]);
|
||||
|
||||
if (!permissionResult.ok) {
|
||||
throw permissionResult.error;
|
||||
}
|
||||
|
||||
const adapter = await createNip07Adapter(extension);
|
||||
adapter.pubkey = pubkey;
|
||||
setActiveSigner(adapter);
|
||||
|
||||
@@ -327,13 +327,14 @@ export async function requestEnablePermissions(
|
||||
.filter(Boolean)
|
||||
: [];
|
||||
|
||||
const permissionVariants = [null];
|
||||
const permissionVariants = [];
|
||||
if (normalized.length) {
|
||||
permissionVariants.push({
|
||||
permissions: normalized.map((method) => ({ method })),
|
||||
});
|
||||
permissionVariants.push({ permissions: normalized });
|
||||
}
|
||||
permissionVariants.push(null);
|
||||
|
||||
const enableTimeoutMs = getEnableVariantTimeoutMs();
|
||||
const loginTimeoutMs = getNip07LoginTimeoutMs();
|
||||
|
||||
Reference in new issue
Block a user