login with exposed api for web page fixed.
This commit is contained in:
@@ -1254,13 +1254,13 @@ class WindowNostr {
|
||||
if (event.detail.method === 'extension') {
|
||||
this.authenticatedExtension = event.detail.extension;
|
||||
console.log('WindowNostr: Captured authenticated extension:', this.authenticatedExtension?.constructor?.name);
|
||||
|
||||
// Re-install our facade to ensure we intercept signEvent calls
|
||||
// Extensions may overwrite window.nostr after authentication
|
||||
if (typeof window !== 'undefined') {
|
||||
console.log('WindowNostr: Re-installing facade after authentication');
|
||||
window.nostr = this;
|
||||
}
|
||||
}
|
||||
|
||||
// CRITICAL FIX: Re-install our facade for ALL authentication methods
|
||||
// Extensions may overwrite window.nostr after ANY authentication, not just extension auth
|
||||
if (typeof window !== 'undefined') {
|
||||
console.log('WindowNostr: Re-installing facade after', this.authState?.method, 'authentication');
|
||||
window.nostr = this;
|
||||
}
|
||||
|
||||
console.log('WindowNostr: Auth state updated:', this.authState?.method);
|
||||
@@ -1270,6 +1270,12 @@ class WindowNostr {
|
||||
this.authState = null;
|
||||
this.authenticatedExtension = null;
|
||||
console.log('WindowNostr: Auth state cleared');
|
||||
|
||||
// Re-install facade after logout to ensure we maintain control
|
||||
if (typeof window !== 'undefined') {
|
||||
console.log('WindowNostr: Re-installing facade after logout');
|
||||
window.nostr = this;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user