@konemono/nostr-login 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/unpkg.js +1 -1
- package/package.json +1 -1
- package/src/modules/AuthNostrService.ts +14 -12
package/package.json
CHANGED
|
@@ -141,18 +141,20 @@ class AuthNostrService extends EventEmitter implements Signer {
|
|
|
141
141
|
const resolved = AmberDirectSigner.resolvePending(response.id, response.type, response.result);
|
|
142
142
|
if (resolved) {
|
|
143
143
|
console.log('[AuthNostrService] Resolved pending Amber promise');
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
144
|
+
} else {
|
|
145
|
+
// resolvePendingが失敗した場合、ページリロード時などは二度目のログイン
|
|
146
|
+
console.log('[AuthNostrService] No pending promise, handling as second login');
|
|
147
|
+
if (response.type === 'get_public_key' || response.type.includes('pub')) {
|
|
148
|
+
const info: Info = {
|
|
149
|
+
pubkey: response.result,
|
|
150
|
+
name: nip19.npubEncode(response.result),
|
|
151
|
+
authMethod: 'amber' as any,
|
|
152
|
+
relays: [],
|
|
153
|
+
signerPubkey: '',
|
|
154
|
+
};
|
|
155
|
+
console.log('[AuthNostrService] Amber login success:', info);
|
|
156
|
+
this.onAuth('login', info);
|
|
157
|
+
}
|
|
156
158
|
}
|
|
157
159
|
|
|
158
160
|
// URLクリーンアップをより徹底的に
|