forked from jsnbuchanan/crowd-funder-for-time-pwa
fix: On test page, switch back to the current user (and not User 0).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user