feat: wire real signature verification in onboarding

OnboardingVerify.vue now signs a random challenge via node.signChallenge
and auto-verifies using identity.verify with the node's DID. Shows
green checkmark on cryptographic verification success.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-12 22:55:38 +00:00
parent fa64b4302e
commit fa13de36e7
2 changed files with 16 additions and 4 deletions

View File

@@ -92,6 +92,7 @@ const router = useRouter()
const verified = ref(false)
const isSigning = ref(false)
const signature = ref('')
const currentChallenge = ref('')
const errorMessage = ref('')
const serverStarting = ref(false)
@@ -108,11 +109,22 @@ async function signChallenge() {
for (let attempt = 0; attempt < 3; attempt++) {
try {
const challenge = generateChallenge()
const { signature: sig } = await rpcClient.signChallenge(challenge)
currentChallenge.value = generateChallenge()
const { signature: sig } = await rpcClient.signChallenge(currentChallenge.value)
signature.value = sig
verified.value = true
isSigning.value = false
// Auto-verify the signature using identity.verify
const did = localStorage.getItem('neode_did')
if (did) {
const result = await rpcClient.call({
method: 'identity.verify',
params: { did, data: currentChallenge.value, signature: sig },
}) as { valid: boolean }
verified.value = result.valid !== false
} else {
verified.value = true
}
return
} catch (err) {
const msg = err instanceof Error ? err.message : ''