|
|
@ -50,6 +50,10 @@ export async function testServerRegisterUser() { |
|
|
|
"@/db/databaseUtil" |
|
|
|
); |
|
|
|
const settings = await retrieveSettingsForActiveAccount(); |
|
|
|
const currentDid = settings?.activeDid; |
|
|
|
if (!currentDid) { |
|
|
|
throw new Error("No active DID found"); |
|
|
|
} |
|
|
|
|
|
|
|
// Make a claim
|
|
|
|
const vcClaim = { |
|
|
@ -57,7 +61,7 @@ export async function testServerRegisterUser() { |
|
|
|
"@type": "RegisterAction", |
|
|
|
agent: { identifier: identity0.did }, |
|
|
|
object: SERVICE_ID, |
|
|
|
participant: { identifier: settings.activeDid }, |
|
|
|
participant: { identifier: currentDid }, |
|
|
|
}; |
|
|
|
|
|
|
|
// Make a payload for the claim
|
|
|
@ -94,5 +98,12 @@ export async function testServerRegisterUser() { |
|
|
|
|
|
|
|
const resp = await axios.post(url, payload, { headers }); |
|
|
|
logger.log("User registration result:", resp); |
|
|
|
|
|
|
|
const platformService = await PlatformServiceFactory.getInstance(); |
|
|
|
await platformService.updateDefaultSettings({ activeDid: currentDid }); |
|
|
|
await platformService.updateDidSpecificSettings(currentDid!, { |
|
|
|
isRegistered: true, |
|
|
|
}); |
|
|
|
|
|
|
|
return resp; |
|
|
|
} |
|
|
|