fix: keep node key out of profile signer picker
Demo images / Build & push demo images (push) Successful in 3m26s
Demo images / Build & push demo images (push) Successful in 3m26s
This commit is contained in:
@@ -55,6 +55,10 @@ impl RpcHandler {
|
|||||||
"did": id.did,
|
"did": id.did,
|
||||||
"created_at": id.created_at,
|
"created_at": id.created_at,
|
||||||
"is_default": is_default,
|
"is_default": is_default,
|
||||||
|
// The node's operational Nostr key is intentionally
|
||||||
|
// distinguishable from user profile identities. Clients
|
||||||
|
// must never offer it in app sign-in pickers.
|
||||||
|
"is_node": is_node,
|
||||||
"nostr_pubkey": nostr_pubkey,
|
"nostr_pubkey": nostr_pubkey,
|
||||||
"nostr_npub": nostr_npub,
|
"nostr_npub": nostr_npub,
|
||||||
"profile": id.profile,
|
"profile": id.profile,
|
||||||
|
|||||||
@@ -45,13 +45,13 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="identities.length === 0" class="text-center py-8">
|
<div v-else-if="userIdentities.length === 0" class="text-center py-8">
|
||||||
<p class="text-white/50 text-sm">No identities found.</p>
|
<p class="text-white/50 text-sm">No identities found.</p>
|
||||||
<p class="text-white/30 text-xs mt-1">Create one in Settings → Credentials</p>
|
<p class="text-white/30 text-xs mt-1">Create one in Settings → Credentials</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
v-for="identity in identities"
|
v-for="identity in userIdentities"
|
||||||
:key="identity.id"
|
:key="identity.id"
|
||||||
type="button"
|
type="button"
|
||||||
role="radio"
|
role="radio"
|
||||||
@@ -130,6 +130,7 @@ interface Identity {
|
|||||||
is_default: boolean
|
is_default: boolean
|
||||||
nostr_pubkey?: string
|
nostr_pubkey?: string
|
||||||
nostr_npub?: string
|
nostr_npub?: string
|
||||||
|
is_node?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -148,10 +149,18 @@ const selectedId = ref<string | null>(null)
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const loadError = ref<string | null>(null)
|
const loadError = ref<string | null>(null)
|
||||||
|
|
||||||
|
// The node key authenticates the appliance itself (mesh/discovery and other
|
||||||
|
// platform operations), not the person's public profile. The API marks it
|
||||||
|
// explicitly; keep a defensive name/purpose fallback for older nodes that do
|
||||||
|
// not send is_node yet.
|
||||||
|
const userIdentities = computed(() => identities.value.filter(identity =>
|
||||||
|
!identity.is_node && identity.name.trim().toLowerCase() !== 'node'
|
||||||
|
))
|
||||||
|
|
||||||
useModalKeyboard(modalRef, computed(() => props.show), () => emit('cancel'))
|
useModalKeyboard(modalRef, computed(() => props.show), () => emit('cancel'))
|
||||||
|
|
||||||
const hasNostrKey = computed(() => {
|
const hasNostrKey = computed(() => {
|
||||||
const selected = identities.value.find(i => i.id === selectedId.value)
|
const selected = userIdentities.value.find(i => i.id === selectedId.value)
|
||||||
return selected?.nostr_pubkey != null
|
return selected?.nostr_pubkey != null
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -169,8 +178,8 @@ async function loadIdentities() {
|
|||||||
try {
|
try {
|
||||||
const res = await rpcClient.call<{ identities: Identity[] }>({ method: 'identity.list' })
|
const res = await rpcClient.call<{ identities: Identity[] }>({ method: 'identity.list' })
|
||||||
identities.value = res.identities || []
|
identities.value = res.identities || []
|
||||||
const defaultId = identities.value.find(i => i.is_default && i.nostr_pubkey)
|
const defaultId = userIdentities.value.find(i => i.is_default && i.nostr_pubkey)
|
||||||
|| identities.value.find(i => i.nostr_pubkey)
|
|| userIdentities.value.find(i => i.nostr_pubkey)
|
||||||
if (defaultId) selectedId.value = defaultId.id
|
if (defaultId) selectedId.value = defaultId.id
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
identities.value = []
|
identities.value = []
|
||||||
@@ -183,7 +192,7 @@ async function loadIdentities() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function confirm() {
|
function confirm() {
|
||||||
const selected = identities.value.find(i => i.id === selectedId.value)
|
const selected = userIdentities.value.find(i => i.id === selectedId.value)
|
||||||
if (selected) emit('select', selected)
|
if (selected) emit('select', selected)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user