feat: Add easier way for test users to register themselves.

This commit is contained in:
2025-08-13 12:18:06 -06:00
parent 24a2dce43e
commit a221a5c5ed
4 changed files with 92 additions and 35 deletions

View File

@@ -1348,12 +1348,12 @@ export async function createEndorserJwtVcFromClaim(
}
/**
* Create a JWT for a RegisterAction claim.
* Create a JWT for a RegisterAction claim, used for registrations & invites.
*
* @param activeDid - The DID of the user creating the invite
* @param contact - The contact to register, with a 'did' field (all optional for invites)
* @param identifier - The identifier for the invite, usually random
* @param expiresIn - The number of seconds until the invite expires
* @param contact - Optional - The contact to register, with a 'did' field (all optional for invites)
* @param identifier - Optional - The identifier for the invite, usually random
* @param expiresIn - Optional - The number of seconds until the invite expires
* @returns The JWT for the RegisterAction claim
*/
export async function createInviteJwt(
@@ -1367,7 +1367,7 @@ export async function createInviteJwt(
"@type": "RegisterAction",
agent: { identifier: activeDid },
object: SERVICE_ID,
identifier: identifier,
identifier: identifier, // not sent if undefined
};
if (contact?.did) {
vcClaim.participant = { identifier: contact.did };