diff --git a/docker-compose.databases.yml b/docker-compose.databases.yml index 04a747497..2e800546e 100644 --- a/docker-compose.databases.yml +++ b/docker-compose.databases.yml @@ -10,7 +10,7 @@ services: environment: - POSTGRES_USER=${POSTGRES_USER:-postgres} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} - - POSTGRES_MULTIPLE_DATABASES=registry,provisioner + - POSTGRES_MULTIPLE_DATABASES=registry,provisioner,evoting volumes: - postgres_data:/var/lib/postgresql/data - ./db/init-multiple-databases.sh:/docker-entrypoint-initdb.d/init-multiple-databases.sh diff --git a/infrastructure/dev-sandbox/src/routes/+page.svelte b/infrastructure/dev-sandbox/src/routes/+page.svelte index d5e645e81..e1c946bf6 100644 --- a/infrastructure/dev-sandbox/src/routes/+page.svelte +++ b/infrastructure/dev-sandbox/src/routes/+page.svelte @@ -331,7 +331,11 @@ if (text) { w3dsInput = text.trim(); actionError = null; - addLog("info", "Decoded QR", text.slice(0, 50) + (text.length > 50 ? "…" : "")); + addLog( + "info", + "Decoded QR", + text.slice(0, 50) + (text.length > 50 ? "…" : ""), + ); } else { qrDecodeError = "No QR code found in image."; } @@ -354,8 +358,8 @@ } function handlePaste(e: ClipboardEvent) { - const item = Array.from(e.clipboardData?.items ?? []).find( - (it) => it.type.startsWith("image/"), + const item = Array.from(e.clipboardData?.items ?? []).find((it) => + it.type.startsWith("image/"), ); const file = item?.getAsFile(); if (file) { @@ -428,21 +432,31 @@ } else { const sessionId = url.searchParams.get("session") ?? ""; const redirectUri = url.searchParams.get("redirect_uri") ?? ""; + const dataParam = url.searchParams.get("data") ?? ""; if (!sessionId || !redirectUri) { actionError = "w3ds://sign needs session and redirect_uri."; return; } + // Decode base64 data if present, otherwise fallback to sessionId + let messageToSign = sessionId; + if (dataParam) { + try { + messageToSign = atob(dataParam); + } catch { + messageToSign = dataParam; + } + } const signature = await signPayload({ cryptoAdapter: adapter, keyId: selectedIdentity.keyId, context: "onboarding", - payload: sessionId, + payload: messageToSign, }); const body = { sessionId, signature, w3id: selectedIdentity.w3id, - message: sessionId, + message: messageToSign, }; const res = await fetch(redirectUri, { method: "POST", @@ -578,7 +592,8 @@

Paste a w3ds://auth or w3ds://sign URI (or HTTP URL with session/redirect_uri). - You can also upload or paste an image of a QR code to decode the request. + You can also upload or paste an image of a QR code to decode + the request.

{ motd = loadMotdJSON(); }); -dotenv.config({ path: path.resolve(__dirname, "../../../.env") }); +dotenv.config({ path: path.resolve(__dirname, "../../../../.env") }); const server = fastify({ logger: true });