Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 3 additions & 20 deletions infrastructure/eid-wallet/src/routes/(app)/scan-qr/scanLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ export function createScanLogic({
created ? "key-generated" : "key-exists",
);

const w3idResult = await globalState.keyService.getPublicKey(
vault.ename,
"signing",
);
const w3idResult = vault.ename;
if (!w3idResult) {
throw new Error("Failed to get W3ID");
}
Expand All @@ -260,18 +257,10 @@ export function createScanLogic({
const authPayload = {
ename: vault.ename,
session: get(session),
w3id: w3idResult,
signature: signature,
appVersion: "0.4.0",
};

console.log("🔐 Auth payload with signature:", {
ename: authPayload.ename,
session: authPayload.session,
w3id: authPayload.w3id,
signatureLength: authPayload.signature.length,
});

const redirectUrl = get(redirect);
if (!redirectUrl) {
throw new Error(
Expand Down Expand Up @@ -534,10 +523,7 @@ export function createScanLogic({
created ? "key-generated" : "key-exists",
);

const w3idResult = await globalState.keyService.getPublicKey(
vault.ename,
"signing",
);
const w3idResult = vault.ename;
if (!w3idResult) {
throw new Error("Failed to get W3ID");
}
Expand Down Expand Up @@ -678,10 +664,7 @@ export function createScanLogic({
created ? "key-generated" : "key-exists",
);

const w3idResult = await globalState.keyService.getPublicKey(
vault.ename,
"signing",
);
const w3idResult = vault.ename;
if (!w3idResult) {
throw new Error("Failed to get W3ID");
}
Expand Down
1 change: 1 addition & 0 deletions infrastructure/evault-core/src/core/db/db.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export class DbService {
id,
ontology: meta.ontology,
acl,
parsed: meta.payload,
},
envelopes: createdEnvelopes,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ export class VaultAccessGuard {

// Check if envelope exists and user has access
const { hasAccess, exists } = await this.checkAccess(metaEnvelopeId, context);

// For update operations, if envelope doesn't exist, allow the resolver to create it
if (!exists && args.input) {
// This is an update/create operation - let the resolver handle it
const result = await resolver(parent, args, context);
return this.filterACL(result);
}

if (!hasAccess) {
// If envelope doesn't exist, return null (not found)
if (!exists) {
Expand Down
Loading
Loading