diff --git a/src/api/users.ts b/src/api/users.ts index 1415c82..3dfa2b6 100644 --- a/src/api/users.ts +++ b/src/api/users.ts @@ -265,10 +265,11 @@ export async function sendSignedUpdate( export async function getIdentityClaim( authToken: string, - walletAddress: string, + proofType: "ethereum" | "minisign", + signer: string, ): Promise<{ did: string, claim: string }> { const url = `${BACKEND_URL}/api/v1/accounts/identity_proof` - const queryParams = { proof_type: "ethereum", signer: walletAddress } + const queryParams = { proof_type: proofType, signer } const response = await http(url, { authToken, queryParams }) const data = await response.json() return data @@ -284,7 +285,7 @@ export async function createIdentityProof( method: "POST", json: { did: did, - signature: signature.replace(/0x/, ""), + signature: signature.replace(/^0x/, ""), }, authToken, }) diff --git a/src/composables/ethereum-address-verification.ts b/src/composables/ethereum-address-verification.ts index 063fb54..ff8c952 100644 --- a/src/composables/ethereum-address-verification.ts +++ b/src/composables/ethereum-address-verification.ts @@ -13,7 +13,11 @@ async function verifyEthereumAddress(): Promise { } const walletAddress = await signer.getAddress() const authToken = ensureAuthToken() - const { did, claim } = await getIdentityClaim(authToken, walletAddress) + const { did, claim } = await getIdentityClaim( + authToken, + "ethereum", + walletAddress, + ) const signature = await getWalletSignature(signer, claim) const user = await createIdentityProof( authToken, diff --git a/src/router/index.ts b/src/router/index.ts index 51cb557..2131fc3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,6 +2,7 @@ import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router" import AboutPage from "@/views/About.vue" import HomeTimeline from "@/views/HomeTimeline.vue" +import IdentityProof from "@/views/IdentityProof.vue" import LandingPage from "../views/LandingPage.vue" import NotificationList from "../views/NotificationList.vue" import ProfileDirectory from "../views/ProfileDirectory.vue" @@ -119,6 +120,12 @@ const routes: Array = [ component: ProfileForm, meta: { onlyAuthenticated: true }, }, + { + path: "/settings/identity-proof", + name: "identity-proof", + component: IdentityProof, + meta: { onlyAuthenticated: true }, + }, { path: "/subscriptions/settings", name: "subscriptions-settings", diff --git a/src/views/IdentityProof.vue b/src/views/IdentityProof.vue new file mode 100644 index 0000000..9be7853 --- /dev/null +++ b/src/views/IdentityProof.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 03485f3..d77b536 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -52,6 +52,14 @@ Link ethereum address +
  • + + Link minisign key + +