forked from trent_larson/crowd-funder-for-time-pwa
change accessToken to take a DID
This commit is contained in:
@@ -282,7 +282,7 @@ export default class ContactAmountssView extends Vue {
|
||||
};
|
||||
|
||||
// Make a payload for the claim
|
||||
const vcPayload = {
|
||||
const vcPayload: didJwt.JWTPayload = {
|
||||
vc: {
|
||||
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
||||
type: ["VerifiableCredential"],
|
||||
@@ -307,7 +307,7 @@ export default class ContactAmountssView extends Vue {
|
||||
// Make the xhr request payload
|
||||
const payload = JSON.stringify({ jwtEncoded: vcJwt });
|
||||
const url = this.apiServer + "/api/v2/claim";
|
||||
const token = await accessToken(identity);
|
||||
const token = await accessToken(this.activeDid);
|
||||
const headers = {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: "Bearer " + token,
|
||||
@@ -316,7 +316,8 @@ export default class ContactAmountssView extends Vue {
|
||||
try {
|
||||
const resp = await this.axios.post(url, payload, { headers });
|
||||
if (resp.data?.success) {
|
||||
record.amountConfirmed = origClaim.object?.amountOfThisGood || 1;
|
||||
record.amountConfirmed =
|
||||
(origClaim.object?.amountOfThisGood as number) || 1;
|
||||
}
|
||||
} catch (error) {
|
||||
let userMessage = "There was an error. See logs for more info.";
|
||||
|
||||
Reference in New Issue
Block a user