Skip to content

Commit

Permalink
feat: more bugs with mt tests
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Burdett <[email protected]>
  • Loading branch information
burdettadam committed Nov 14, 2023
1 parent 0da6379 commit 440a983
Show file tree
Hide file tree
Showing 14 changed files with 1,167 additions and 31 deletions.
36 changes: 23 additions & 13 deletions oid4vci/demo/frontend/src/FormPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const FormPage = () => {
const handleSubmit = () => {
// Set the Axios configuration for CORS and credentials
axios.defaults.withCredentials = true; // Enable credentials (cookies, etc.)
axios.defaults.headers.common['Access-Control-Allow-Origin'] = 'http://localhost:3001'; // Adjust the origin as needed
axios.defaults.headers.common["Access-Control-Allow-Origin"] =
"http://localhost:3001"; // Adjust the origin as needed

// api call to controller, `POST /exchange/submit`
axios
Expand All @@ -32,22 +33,31 @@ const FormPage = () => {
})
.then((response) => {
console.log(response.data);
const {exchange_id} = response.data
// TODO: call offer endpoint
const { exchange_id } = response.data;
// TODO: call offer endpoint

const queryParams = {
credentials: [selectedCredential],
user_pin_required: false,
exchange_id: exchange_id,
};
axios.get("http://localhost:3001/oid4vci/draft-11/credential-offer", { params: queryParams })
const queryParams = {
credentials: selectedCredential,
user_pin_required: false,
exchange_id: exchange_id,
};
console.log("get offer params:");
console.log(queryParams);
axios
.get("http://localhost:3001/oid4vci/draft-11/credential-offer", {
params: queryParams,
headers: {
accept: "application/json",
},
})
.then((response) => {
console.log(response.data);
const credentialOffer = response.data;
const {exchange_id} = response.data;
navigate(`/qr-code`, { state: { credentialOffer, exchange_id: exchange_id } });
})
})
navigate(`/qr-code`, {
state: { credentialOffer, exchange_id: exchange_id },
});
});
})
.catch((error) => {
console.error(error);
});
Expand Down
Empty file.
Loading

0 comments on commit 440a983

Please sign in to comment.