File tree Expand file tree Collapse file tree
eid-wallet/src/routes/(auth)/verify Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { provision , syncPublicKeyToEvault , signPayload } from " wallet-sdk" ;
2+ import {
3+ provision ,
4+ syncPublicKeyToEvaultWithOptions ,
5+ signPayload ,
6+ } from " wallet-sdk" ;
37 import { env } from " $env/dynamic/public" ;
48 import { PersistingWebCryptoAdapter } from " $lib/PersistingWebCryptoAdapter" ;
59 import {
204208 addLog (" info" , " Syncing public key…" );
205209 try {
206210 const token = await ensurePlatformToken (identity );
207- await syncPublicKeyToEvault ({
211+ await syncPublicKeyToEvaultWithOptions ({
208212 evaultUrl: identity .uri ,
209213 eName: identity .w3id ,
210214 cryptoAdapter: adapter ,
211215 keyId: identity .keyId ,
216+ context: " onboarding" ,
212217 token ,
213218 });
214219 addLog (" success" , " Public key synced" );
296301 const signature = await signPayload ({
297302 cryptoAdapter: adapter ,
298303 keyId: selectedIdentity .keyId ,
304+ context: " onboarding" ,
299305 payload: sessionId ,
300306 });
301307 const body = {
339345 const signature = await signPayload ({
340346 cryptoAdapter: adapter ,
341347 keyId: selectedIdentity .keyId ,
348+ context: " onboarding" ,
342349 payload: sessionId ,
343350 });
344351 const body = {
404411 const sig = await signPayload ({
405412 cryptoAdapter: adapter ,
406413 keyId: selectedIdentity .keyId ,
414+ context: " onboarding" ,
407415 payload: signPayloadInput ,
408416 });
409417 signResult = sig ;
Original file line number Diff line number Diff line change @@ -272,11 +272,15 @@ onMount(async () => {
272272 };
273273 } else {
274274 // Normal flow for approved status via wallet-sdk
275+ const verificationId = $verificaitonId ;
276+ if (! verificationId ) {
277+ throw new Error (" Verification ID required" );
278+ }
275279 const result = await provision (globalState .walletSdkAdapter , {
276280 registryUrl: PUBLIC_REGISTRY_URL ,
277281 provisionerUrl: PUBLIC_PROVISIONER_URL ,
278282 namespace: uuidv4 (),
279- verificationId: $verificaitonId ,
283+ verificationId ,
280284 keyId: " default" ,
281285 context: " onboarding" ,
282286 isPreVerification: false ,
Original file line number Diff line number Diff line change @@ -5,3 +5,9 @@ export { authenticate } from "./auth.js";
55export type { AuthenticateOptions , AuthenticateResult } from "./auth.js" ;
66export { syncPublicKeyToEvault } from "./sync-public-key.js" ;
77export type { SyncPublicKeyOptions } from "./sync-public-key.js" ;
8+ export { signPayload } from "./sync-and-sign.js" ;
9+ export type { SignPayloadOptions } from "./sync-and-sign.js" ;
10+ export {
11+ syncPublicKeyToEvault as syncPublicKeyToEvaultWithOptions ,
12+ } from "./sync-and-sign.js" ;
13+ export type { SyncPublicKeyToEvaultOptions } from "./sync-and-sign.js" ;
You can’t perform that action at this time.
0 commit comments