From b0562be830ed971450ed9668e1e8b7dc2a70205c Mon Sep 17 00:00:00 2001 From: cedoor Date: Fri, 5 Jul 2024 12:30:58 +0100 Subject: [PATCH 1/2] fix(webapp): set correct identity parameters --- apps/web-app/src/app/page.tsx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/apps/web-app/src/app/page.tsx b/apps/web-app/src/app/page.tsx index 95dcb8b..f99056a 100644 --- a/apps/web-app/src/app/page.tsx +++ b/apps/web-app/src/app/page.tsx @@ -6,7 +6,6 @@ import { useRouter } from "next/navigation" import { useCallback, useEffect, useState } from "react" import Stepper from "../components/Stepper" import { useLogContext } from "../context/LogContext" -import shortenString from "../utils/shortenString" export default function IdentitiesPage() { const router = useRouter() @@ -16,8 +15,12 @@ export default function IdentitiesPage() { useEffect(() => { const privateKey = localStorage.getItem("identity") + console.log(privateKey) + if (privateKey) { - const identity = new Identity(privateKey) + const identity = Identity.import(privateKey) + + console.log(identity.privateKey) setIdentity(identity) @@ -32,7 +35,7 @@ export default function IdentitiesPage() { setIdentity(identity) - localStorage.setItem("identity", identity.privateKey.toString()) + localStorage.setItem("identity", identity.export()) setLog("Your new Semaphore identity has just been created 🎉") }, [setLog]) @@ -67,16 +70,16 @@ export default function IdentitiesPage() { {_identity && ( - - - Private Key: {_identity.privateKey.toString()} + + + Private Key (base64):
{_identity.export()}
- - Public Key: [{shortenString(_identity.publicKey[0].toString(), [8, 8])},{" "} - {shortenString(_identity.publicKey[1].toString(), [8, 8])}] + + Public Key:
[{_identity.publicKey[0].toString()},{" "} + {_identity.publicKey[1].toString()}]
- - Commitment: {_identity.commitment.toString()} + + Commitment:
{_identity.commitment.toString()}
)} From e3685eb0a8286fc3de044bb0c6c434655fd9e9a4 Mon Sep 17 00:00:00 2001 From: cedoor Date: Fri, 5 Jul 2024 14:34:31 +0100 Subject: [PATCH 2/2] chore(web-app): remove console logs --- apps/web-app/src/app/page.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/web-app/src/app/page.tsx b/apps/web-app/src/app/page.tsx index f99056a..02e026f 100644 --- a/apps/web-app/src/app/page.tsx +++ b/apps/web-app/src/app/page.tsx @@ -15,13 +15,9 @@ export default function IdentitiesPage() { useEffect(() => { const privateKey = localStorage.getItem("identity") - console.log(privateKey) - if (privateKey) { const identity = Identity.import(privateKey) - console.log(identity.privateKey) - setIdentity(identity) setLog("Your Semaphore identity has been retrieved from the browser cache 👌🏽")