forked from jsnbuchanan/crowd-funder-for-time-pwa
parameterize main identifier (to prepare the way for multiple)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import axios from "axios";
|
||||
import * as didJwt from "did-jwt";
|
||||
import { AppString } from "@/constants/app";
|
||||
import { accountsDB } from "../db";
|
||||
import { db } from "../db";
|
||||
import { SERVICE_ID } from "../libs/veramo/setup";
|
||||
import { deriveAddress, newIdentifier } from "../libs/crypto";
|
||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||
|
||||
export async function testServerRegisterUser() {
|
||||
const testUser0Mnem =
|
||||
@@ -13,9 +14,8 @@ export async function testServerRegisterUser() {
|
||||
|
||||
const identity0 = newIdentifier(addr, publicHex, privateHex, deriPath);
|
||||
|
||||
await accountsDB.open();
|
||||
const accounts = await accountsDB.accounts.toArray();
|
||||
const thisIdentity = JSON.parse(accounts[0].identity);
|
||||
await db.open();
|
||||
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||
|
||||
// Make a claim
|
||||
const vcClaim = {
|
||||
@@ -23,7 +23,7 @@ export async function testServerRegisterUser() {
|
||||
"@type": "RegisterAction",
|
||||
agent: { did: identity0.did },
|
||||
object: SERVICE_ID,
|
||||
participant: { did: thisIdentity.did },
|
||||
participant: { did: settings?.activeDid },
|
||||
};
|
||||
// Make a payload for the claim
|
||||
const vcPayload = {
|
||||
@@ -56,5 +56,5 @@ export async function testServerRegisterUser() {
|
||||
};
|
||||
|
||||
const resp = await axios.post(url, payload, { headers });
|
||||
console.log("Result:", resp);
|
||||
console.log("User registration result:", resp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user