Skip to content

Commit

Permalink
Merge pull request #64 from semaphore-protocol/fix/identity-page
Browse files Browse the repository at this point in the history
fix(webapp): set correct identity parameters
  • Loading branch information
cedoor authored Jul 5, 2024
2 parents 141f27c + e3685eb commit b3d1018
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions apps/web-app/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -17,7 +16,7 @@ export default function IdentitiesPage() {
const privateKey = localStorage.getItem("identity")

if (privateKey) {
const identity = new Identity(privateKey)
const identity = Identity.import(privateKey)

setIdentity(identity)

Expand All @@ -32,7 +31,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])
Expand Down Expand Up @@ -67,16 +66,16 @@ export default function IdentitiesPage() {
</HStack>

{_identity && (
<Box pb="6" whiteSpace="nowrap">
<Text textOverflow="ellipsis" overflow="hidden">
Private Key: {_identity.privateKey.toString()}
<Box pb="6" pl="2">
<Text>
<b>Private Key (base64)</b>:<br /> {_identity.export()}
</Text>
<Text textOverflow="ellipsis" overflow="hidden">
Public Key: [{shortenString(_identity.publicKey[0].toString(), [8, 8])},{" "}
{shortenString(_identity.publicKey[1].toString(), [8, 8])}]
<Text>
<b>Public Key</b>:<br /> [{_identity.publicKey[0].toString()},{" "}
{_identity.publicKey[1].toString()}]
</Text>
<Text textOverflow="ellipsis" overflow="hidden">
Commitment: <b>{_identity.commitment.toString()}</b>
<Text>
<b>Commitment</b>:<br /> {_identity.commitment.toString()}
</Text>
</Box>
)}
Expand Down

0 comments on commit b3d1018

Please sign in to comment.