revert: do not block when remote === user pubkey

- Amber may legally use user pubkey as remote id
- Remove validation and warning that caused false negatives
This commit is contained in:
Gigi
2025-10-17 00:45:39 +02:00
parent 680169e312
commit b18dcc29cd
2 changed files with 2 additions and 11 deletions

View File

@@ -259,11 +259,7 @@ 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 {}
}
// Note: Amber may use the user's pubkey as both p-tag target and remote id; don't block on equality
// Skip if we've already reconnected this account
if (reconnectedAccounts.has(account.id)) {

View File

@@ -48,12 +48,7 @@ const LoginOptions: React.FC = () => {
// Get pubkey from signer
const pubkey = await signer.getPublicKey()
// Validate: remote (Amber) pubkey must not equal user pubkey
if ((signer as any).remote === pubkey) {
console.error('[bunker] Invalid bunker URI: remote pubkey equals user pubkey')
setError('Invalid bunker URI (remote equals your pubkey). Generate a fresh Connect link in Amber and try again.')
return
}
// Note: Some signers may mirror user pubkey in remote field; not a hard error
// Create account from signer
const account = new Accounts.NostrConnectAccount(pubkey, signer)