Skip to content

Commit

Permalink
Add todo check for nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
Jdu278 committed Aug 27, 2024
1 parent d7d8c73 commit b21a9fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions models/WalletResponse.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
export type WalletResponse = {
state: string;
vp_token: string; // TODO: add string[]
vp_token: string;
presentation_submission: PresentationSubmission;
nonce: string;
}

type PresentationSubmission = {
Expand Down
7 changes: 0 additions & 7 deletions pages/wallet-redirect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ onMounted(async () => {
const responseCode = ref()
const hash = route.hash
// TODO: add check for nonce
// const nonce = route.query.nonce
// if (nonce !== vpToken.nonce) {
// errorMessage.value = 'Nonce ist falsch';
// return;
// }
if (hash && presentationId) {
try {
const params = new URLSearchParams(hash.slice(1))
Expand Down
5 changes: 4 additions & 1 deletion utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as cbor from 'cbor-web';
import {Buffer} from 'buffer';

export async function getSdJwtClaims(vpToken: string): Promise<{ key: string; value: string }[] | undefined> {
// TODO: edit for multiple Presentations + check nonce

try {
const decodedSdJwt: DecodedSDJwt = await decodeSdJwt(vpToken, digest);
return await getClaims(
Expand All @@ -19,6 +21,8 @@ export async function getSdJwtClaims(vpToken: string): Promise<{ key: string; v
}

export async function getMdocClaims(vpToken: string): Promise<{
// TODO: edit for multiple Presentations + check nonce

[p: string]: { key: string; value: string }
} | undefined> {
try {
Expand All @@ -29,7 +33,6 @@ export async function getMdocClaims(vpToken: string): Promise<{
preferWeb: true

});
// TODO: edit for multiple Presentations
const namespaces = valueOut.documents[0].issuerSigned.nameSpaces;
const firstNamespace = Object.entries(namespaces)[0][0];
const dataArray: TagValue[] = namespaces[firstNamespace];
Expand Down

0 comments on commit b21a9fa

Please sign in to comment.