mirror of
https://github.com/dergigi/boris.git
synced 2025-12-25 10:34:28 +01:00
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:
@@ -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)) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user