mirror of
https://github.com/dergigi/boris.git
synced 2025-12-25 10:34:28 +01:00
chore(bunker): warn if remote pubkey equals user pubkey (invalid state)
- Add sanity check and toast guidance to reconnect via Amber - Helps catch misconfigured bunker URIs that would never respond to requests
This commit is contained in:
@@ -259,6 +259,11 @@ function App() {
|
||||
|
||||
if (account && account.type === 'nostr-connect') {
|
||||
const nostrConnectAccount = account as Accounts.NostrConnectAccount<unknown>
|
||||
// Sanity check: remote (bunker) pubkey must not equal our pubkey
|
||||
if (nostrConnectAccount.signer.remote === nostrConnectAccount.pubkey) {
|
||||
console.warn('[bunker] ❌ Invalid bunker state: remote pubkey equals user pubkey. Please reconnect using a fresh bunker URI from Amber.')
|
||||
try { showToast?.('Reconnect bunker from Amber: invalid remote pubkey detected') } catch {}
|
||||
}
|
||||
|
||||
// Skip if we've already reconnected this account
|
||||
if (reconnectedAccounts.has(account.id)) {
|
||||
|
||||
Reference in New Issue
Block a user