add expiration inside JWANT & refactor getHeaders to move toward supporting did:peer

This commit is contained in:
2024-07-09 17:56:48 -06:00
parent 42fde503e3
commit 45f0a14661
17 changed files with 163 additions and 276 deletions

View File

@@ -245,15 +245,6 @@ export default class NewEditProjectView extends Vue {
return identity;
}
public async getHeaders(identity: IIdentifier) {
const token = await accessToken(identity);
const headers = {
"Content-Type": "application/json",
Authorization: "Bearer " + token,
};
return headers;
}
async mounted() {
await accountsDB.open();
this.numAccounts = await accountsDB.accounts.count();
@@ -460,11 +451,14 @@ export default class NewEditProjectView extends Vue {
const signer = await SimpleSigner(privateKeyHex);
const alg = undefined;
// create a JWT for the request
const vcJwt: string = await didJwt.createJWT(vcPayload, {
alg: alg,
issuer: identity.did,
signer: signer,
});
const vcJwt: string = await didJwt.createJWT(
vcPayload as Partial<didJwt.JWTPayload>,
{
alg: alg,
issuer: identity.did,
signer: signer,
},
);
// Make the xhr request payload